Commits

Philip Jenvey committed 3d71999 Merge

merge py3k

  • Participants
  • Parent commits 62b5d70, 7da16b3
  • Branches py3.3

Comments (0)

Files changed (2)

pypy/interpreter/astcompiler/ast.py

                 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):
 

pypy/interpreter/astcompiler/test/test_compiler.py

         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):