[pypy-commit] pypy py3.3: merge py3k

pjenvey noreply at buildbot.pypy.org
Sun Aug 17 03:07:14 CEST 2014


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3.3
Changeset: r72837:3d71999bc05e
Date: 2014-08-16 18:04 -0700
http://bitbucket.org/pypy/pypy/changeset/3d71999bc05e/

Log:	merge py3k

diff --git a/pypy/interpreter/astcompiler/ast.py b/pypy/interpreter/astcompiler/ast.py
--- a/pypy/interpreter/astcompiler/ast.py
+++ b/pypy/interpreter/astcompiler/ast.py
@@ -2443,7 +2443,8 @@
                 self.kw_defaults = None
         if self.kw_defaults is not None:
             for node in self.kw_defaults:
-                node.sync_app_attrs(space)
+                if node:
+                    node.sync_app_attrs(space)
 
 class arg(AST):
 
diff --git a/pypy/interpreter/astcompiler/test/test_compiler.py b/pypy/interpreter/astcompiler/test/test_compiler.py
--- a/pypy/interpreter/astcompiler/test/test_compiler.py
+++ b/pypy/interpreter/astcompiler/test/test_compiler.py
@@ -1052,6 +1052,13 @@
         exec('# -*- coding: utf-8 -*-\n\nu = "\xf0\x9f\x92\x8b"', d)
         assert len(d['u']) == 4
 
+    def test_kw_defaults_None(self):
+        import _ast
+        source = "def foo(self, *args, name): pass"
+        ast = compile(source, '', 'exec', _ast.PyCF_ONLY_AST)
+        # compiling the produced AST previously triggered a crash
+        compile(ast, '', 'exec')
+
 
 class TestOptimizations:
     def count_instructions(self, source):


More information about the pypy-commit mailing list