Commit Graph

122 Commits

Author SHA1 Message Date
Benjamin Peterson c30d05855a merge 3.3 (#19098) 2013-09-26 22:21:41 -04:00
Benjamin Peterson 305e5aac85 don't scale compiler stack frames if the recursion limit is huge (closes #19098) 2013-09-26 22:17:45 -04:00
Victor Stinner 14e461d5b9 Close #11619: The parser and the import machinery do not encode Unicode
filenames anymore on Windows.
2013-08-26 22:28:21 +02:00
Victor Stinner 9a4fb66966 Issue #18408: ste_new() initialize all attributes before handling error
If an attribute is not initialized, the destructor can crash
2013-07-11 22:49:00 +02:00
Benjamin Peterson e2135c6158 move definition to top of block 2013-05-16 19:38:22 -05:00
Benjamin Peterson e8e14591eb rather than passing locals to the class body, just execute the class body in the proper environment 2013-05-16 14:37:25 -05:00
Benjamin Peterson 1e93b06007 complain about "global __class__" in a class body (closes #17983) 2013-05-15 16:17:25 -05:00
Benjamin Peterson 312595ce3a hide the __class__ closure from the class body (#12370) 2013-05-15 15:26:42 -05:00
Benjamin Peterson cda75be02a unify some ast.argument's attrs; change Attribute column offset (closes #16795)
Patch from Sven Brauch.
2013-03-18 10:48:58 -07:00
Benjamin Peterson 442f20996d create NameConstant AST class for None, True, and False literals (closes #16619) 2012-12-06 17:41:04 -05:00
Mark Dickinson 073f067369 Issue #16546: merge fix from 3.3 2012-11-25 14:37:43 +00:00
Mark Dickinson ded35aeb9d Issue #16546: make ast.YieldFrom argument mandatory. 2012-11-25 14:36:26 +00:00
Nick Coghlan e69bfc3fb6 Issue #5765: Merge from 3.3 2012-11-04 23:53:15 +10:00
Nick Coghlan aab9c2b2ea Issue #5765: Apply a hard recursion limit in the compiler
Previously, excessive nesting in expressions would blow the
stack and segfault the interpreter. Now, a hard limit based
on the configured recursion limit and a hardcoded scaling
factor is applied.
2012-11-04 23:14:34 +10:00
Benjamin Peterson d9c8702c0f point errors related to nonlocals and globals to the statement declaring them (closes #10189) 2012-10-31 20:26:20 -04:00
Benjamin Peterson e132f527c9 check return value of _PyUnicode_AsString 2012-10-31 19:01:42 -04:00
Christian Heimes 10ca1fee8f Cleanup 'k' when the creation of PySTEntryObject fails. ad3824a90261 used to decref 'k' in too many error cases. 2012-09-12 17:58:20 +02:00
Christian Heimes 55ad6515c9 Cleanup 'k' when the creation of PySTEntryObject fails. ad3824a90261 used to decref 'k' in too many error cases. 2012-09-12 17:58:10 +02:00
Christian Heimes 9c5b521c71 Partly revert ad3824a90261 and add comment about reference ownership 2012-09-12 17:53:15 +02:00
Christian Heimes 1526582df6 Partly revert ad3824a90261 and add comment about reference ownership 2012-09-12 17:52:46 +02:00
Christian Heimes 310f81449a Closed reference leak of variable 'k' in function ste_new which wasn't decrefed in error cases 2012-09-10 03:09:17 +02:00
Christian Heimes 837e53a7c2 Closed reference leak of variable 'k' in function ste_new which wasn't decrefed in error cases 2012-09-10 03:08:46 +02:00
Nick Coghlan 0b43bcf528 Close #14857: fix regression in references to PEP 3135 implicit __class__ closure variable. Reopens issue #12370, but also updates unittest.mock to workaround that issue 2012-05-27 18:17:07 +10:00
Benjamin Peterson 527c622926 make YieldFrom its own distinct from Yield (closes #13780) 2012-01-14 08:58:23 -05:00
Nick Coghlan 1f7ce62bd6 Implement PEP 380 - 'yield from' (closes #11682) 2012-01-13 21:43:40 +10:00
Amaury Forgeot d'Arc 9028a10144 Issue #13343: Fix a SystemError when a lambda expression uses a global
variable in the default value of a keyword-only argument:
(lambda *, arg=GLOBAL_NAME: None)
2011-11-04 22:29:24 +01:00
Amaury Forgeot d'Arc 97c1bef6a4 Issue #13343: Fix a SystemError when a lambda expression uses a global
variable in the default value of a keyword-only argument:
(lambda *, arg=GLOBAL_NAME: None)
2011-11-04 22:17:45 +01:00
Martin v. Löwis d63a3b8beb Implement PEP 393. 2011-09-28 07:41:54 +02:00
Benjamin Peterson 9d872e19aa fix possibily uninitialized memory usage (closes #12474) 2011-07-02 09:22:13 -05:00
Benjamin Peterson 609da58ae5 store the current scope on the stack right away 2011-06-29 22:52:39 -05:00
Benjamin Peterson c2575d55cd remove VISIT_*_IN_BLOCK macros
These are pointless because on error, all blocks will be finalized by
symtable_dealloc.
2011-06-29 15:27:14 -05:00
Benjamin Peterson 28db0fd357 merge 3.2 2011-06-20 22:09:20 -05:00
Benjamin Peterson b7149cad04 fix indentation 2011-06-20 22:09:13 -05:00
Benjamin Peterson f5ff22329b use a invalid name for the __class__ closure for super() (closes #12370)
This prevents the assignment of __class__ in the class body from breaking
super. (Although a determined person could do locals()["@__class__"] = 4)
2011-06-19 19:42:22 -05:00
Benjamin Peterson 43af12b0b4 unify TryExcept and TryFinally (closes #12199) 2011-05-29 11:43:10 -05:00
Benjamin Peterson bf1bbc1452 reflect with statements with multiple items in the AST (closes #12106) 2011-05-27 13:58:08 -05:00
Eli Bendersky dd97fbb2dc Issue #9904: fix and clarify some comments + fix indentation in symtable code 2011-04-10 07:37:26 +03:00
Benjamin Peterson b8ffb60ec6 fix uninitialized struct member #10152 2010-10-20 21:25:23 +00:00
Benjamin Peterson 230b20684f don't identify the toplevel namespace by name #9997 2010-10-16 03:45:45 +00:00
Benjamin Peterson d4efd9eb15 add column offset to all syntax errors 2010-09-20 23:02:10 +00:00
Benjamin Peterson 20f9c3c50f revert unintended changes 2010-07-20 22:39:34 +00:00
Benjamin Peterson 013783c529 move test_trace.py so as not to conflict with future tests for the trace module 2010-07-20 22:37:19 +00:00
Benjamin Peterson c629d51ea9 Merged revisions 81906 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81906 | benjamin.peterson | 2010-06-11 16:40:37 -0500 (Fri, 11 Jun 2010) | 1 line

  different spellings are just unacceptable
........
2010-06-11 21:53:07 +00:00
Antoine Pitrou f95a1b3c53 Recorded merge of revisions 81029 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines

  Untabify C files. Will watch buildbots.
........
2010-05-09 15:52:27 +00:00
Benjamin Peterson f3ebc1f930 Merged revisions 76423-76424 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r76423 | benjamin.peterson | 2009-11-19 19:15:53 -0600 (Thu, 19 Nov 2009) | 1 line

  provide line number for lambdas
........
  r76424 | benjamin.peterson | 2009-11-19 19:16:58 -0600 (Thu, 19 Nov 2009) | 1 line

  genexps have linenos
........
2009-11-20 01:19:41 +00:00
Benjamin Peterson 78565b2216 Merged revisions 73376,73393,73398,73400,73404-73405,73409,73419-73421,73432,73457,73460,73485-73486,73488-73489,73501-73502,73513-73514 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r73376 | benjamin.peterson | 2009-06-11 17:29:23 -0500 (Thu, 11 Jun 2009) | 1 line

  remove check for case handled in sub-function
........
  r73393 | alexandre.vassalotti | 2009-06-12 13:56:57 -0500 (Fri, 12 Jun 2009) | 2 lines

  Clear reference to the static PyExc_RecursionErrorInst in _PyExc_Fini.
........
  r73398 | alexandre.vassalotti | 2009-06-12 15:57:12 -0500 (Fri, 12 Jun 2009) | 3 lines

  Add const qualifier to PyErr_SetFromErrnoWithFilename and to
  PyErr_SetFromErrnoWithUnicodeFilename.
........
  r73400 | alexandre.vassalotti | 2009-06-12 16:43:47 -0500 (Fri, 12 Jun 2009) | 2 lines

  Delete outdated make file for building the parser with MSVC 6.
........
  r73404 | benjamin.peterson | 2009-06-12 20:40:00 -0500 (Fri, 12 Jun 2009) | 1 line

  keep the slice.step field as NULL if no step expression is given
........
  r73405 | benjamin.peterson | 2009-06-12 22:46:30 -0500 (Fri, 12 Jun 2009) | 1 line

  prevent import statements from assigning to None
........
  r73409 | benjamin.peterson | 2009-06-13 08:06:21 -0500 (Sat, 13 Jun 2009) | 1 line

  allow importing from a module named None if it has an 'as' clause
........
  r73419 | benjamin.peterson | 2009-06-13 11:19:19 -0500 (Sat, 13 Jun 2009) | 1 line

  set Print.values to NULL if there are no values
........
  r73420 | benjamin.peterson | 2009-06-13 12:08:53 -0500 (Sat, 13 Jun 2009) | 1 line

  give a better error message when deleting ()
........
  r73421 | benjamin.peterson | 2009-06-13 15:23:33 -0500 (Sat, 13 Jun 2009) | 1 line

  when no module is given in a 'from' relative import, make ImportFrom.module NULL
........
  r73432 | amaury.forgeotdarc | 2009-06-14 16:20:40 -0500 (Sun, 14 Jun 2009) | 3 lines

  #6227: Because of a wrong indentation, the test was not testing what it should.
  Ensure that the snippet in doctest_aliases actually contains aliases.
........
  r73457 | benjamin.peterson | 2009-06-16 18:13:09 -0500 (Tue, 16 Jun 2009) | 1 line

  add underscores
........
  r73460 | benjamin.peterson | 2009-06-16 22:23:04 -0500 (Tue, 16 Jun 2009) | 1 line

  remove unused 'encoding' member from the compiler struct
........
  r73485 | benjamin.peterson | 2009-06-19 17:07:47 -0500 (Fri, 19 Jun 2009) | 1 line

  remove duplicate test
........
  r73486 | benjamin.peterson | 2009-06-19 17:09:17 -0500 (Fri, 19 Jun 2009) | 1 line

  add missing assertion #6313
........
  r73488 | benjamin.peterson | 2009-06-19 17:16:28 -0500 (Fri, 19 Jun 2009) | 1 line

  show that this one isn't used
........
  r73489 | benjamin.peterson | 2009-06-19 17:21:12 -0500 (Fri, 19 Jun 2009) | 1 line

  use closures
........
  r73501 | benjamin.peterson | 2009-06-21 18:01:07 -0500 (Sun, 21 Jun 2009) | 1 line

  don't need to add the name 'lambda' as assigned
........
  r73502 | benjamin.peterson | 2009-06-21 18:03:36 -0500 (Sun, 21 Jun 2009) | 1 line

  remove tmpname support since it's no longer used
........
  r73513 | benjamin.peterson | 2009-06-22 20:18:57 -0500 (Mon, 22 Jun 2009) | 1 line

  fix grammar
........
  r73514 | benjamin.peterson | 2009-06-22 22:01:56 -0500 (Mon, 22 Jun 2009) | 1 line

  remove some unused symtable constants
........
2009-06-28 19:19:51 +00:00
Benjamin Peterson 57512588fa fix error handling of PyNumber_InPlaceOr #6000 2009-05-12 20:39:25 +00:00
Benjamin Peterson acc9dcc688 remove unused variable 2009-04-02 02:27:56 +00:00
Benjamin Peterson d1e5493a26 rewrite error handling to make sense 2009-04-02 02:27:20 +00:00
Benjamin Peterson 22081a1364 fix ref leaks 2009-04-02 01:50:37 +00:00