496 Commits

Author SHA1 Message Date
Benjamin Peterson
6c4fa70da6 make too many nested blocks be a SyntaxError instead of a SystemError (closes #27514)
Patch by Ammar Askar.
2016-07-14 22:00:03 -07:00
Serhiy Storchaka
34cb3f026b Issue #27301: Fixed incorrect return code for error in compile.c. 2016-06-15 20:06:29 +03:00
Serhiy Storchaka
bc62af1bbe Issue #22570: Renamed Py_SETREF to Py_XSETREF. 2016-04-06 09:51:18 +03:00
Victor Stinner
7791165fb3 code_richcompare() now uses the constants types
Issue #25843: When compiling code, don't merge constants if they are equal but
have a different types. For example, "f1, f2 = lambda: 1, lambda: 1.0" is now
correctly compiled to two different functions: f1() returns 1 (int) and f2()
returns 1.0 (int), even if 1 and 1.0 are equal.

Add a new _PyCode_ConstantKey() private function.
2016-01-22 12:33:12 +01:00
Serhiy Storchaka
5951f2300f Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
2015-12-24 10:35:35 +02:00
Benjamin Peterson
0287f2f7cb check return value of PyString_FromStringAndSize for NULL (closes #24734)
Patch by Pankaj Sharma.
2015-07-27 07:47:21 -07:00
Serhiy Storchaka
f0aa88f6e8 Fixed indentation of Python examples in C comments. 2015-06-11 00:06:27 +03:00
Benjamin Peterson
7a6a97352d pop the loop block even for infinite while loops (closes #23048) 2014-12-13 16:06:19 -05:00
Serhiy Storchaka
a86c091a73 Issue #22453: Fexed reference leaks when format error messages in ceval.c.
Warn against the use of leaking macro PyObject_REPR().
2014-11-19 00:11:05 +02:00
Antoine Pitrou
ab4a69158b Issue #21523: Fix over-pessimistic computation of the stack effect of some opcodes in the compiler.
This also fixes a quadratic compilation time issue noticeable when compiling
code with a large number of "and" and "or" operators.
2014-05-23 11:46:03 +02:00
Antoine Pitrou
022db598ac Issue #17645: convert an assert() into a proper exception in _Py_Mangle(). 2013-04-06 21:21:04 +02:00
Meador Inge
0e3755e58a remove unused variable 2012-07-18 17:48:34 -05:00
Meador Inge
b8a569065e Issue #15368: fixing variable typo. 2012-07-18 16:32:37 -05:00
Meador Inge
6642d1f97d Issue #15368: make bytecode generation deterministic. 2012-07-18 14:09:04 -05:00
Benjamin Peterson
0c0d756098 don't let a tuple msg be interpreted as arguments to AssertionError (closes #13268) 2011-10-27 08:21:59 -04:00
Antoine Pitrou
a4d36a9572 Fix misindents in compile.c (for Benjamin).
Of course, whoever used the wrong indentation rules needs to be spanked.
2010-06-22 21:42:05 +00:00
Antoine Pitrou
c83ea137d7 Untabify C files. Will watch buildbots. 2010-05-09 14:46:46 +00:00
Larry Hastings
402b73fb8d Backported PyCapsule from 3.1, and converted most uses of
CObject to PyCapsule.
2010-03-25 00:54:54 +00:00
Benjamin Peterson
0dee9c1b5c prevent lambda functions from having docstrings #8164 2010-03-17 20:41:42 +00:00
Benjamin Peterson
565d78586b normalize exceptions passed to the __exit__ method #7853
In Python 2.x, exceptions in finally blocks are not normalized.  Since with
statements are implemented using finally blocks, ceval.c had to be tweaked to
distinguish between with finally blocks and normal ones.

A test for the finalization of generators containing with statements was also
added.
2010-02-05 02:12:14 +00:00
Alexandre Vassalotti
b646547bb4 Issue #2333: Backport set and dict comprehensions syntax. 2010-01-11 22:36:12 +00:00
Alexandre Vassalotti
ee936a2130 Issue #2335: Backport set literals syntax from Python 3.x. 2010-01-09 23:35:54 +00:00
Mark Dickinson
ccc690d650 Issue #1678380: When distinguishing between -0.0 and 0.0 in
compiler_add_o, use copysign instead of examining the first and last
bytes of the double.  The latter method fails for little-endian
ARM, OABI, where doubles are little-endian but with the words swapped.
2009-11-28 16:32:27 +00:00
Benjamin Peterson
cef9782810 turn goto into do while loop 2009-11-20 02:15:50 +00:00
Mark Dickinson
026ac7cf69 Allow core Python build to succeed under WITHOUT_COMPLEX. The module build stage still fails. 2009-10-15 17:45:39 +00:00