Author: Amaury Forgeot d'Arc <[email protected]>
Branch: py3.5
Changeset: r91078:785e75435a92
Date: 2017-04-18 09:48 +0200
http://bitbucket.org/pypy/pypy/changeset/785e75435a92/

Log:    Attempt to fix 'nonlocal' in class scopes. test_scope and test_super
        are passing again.

diff --git a/pypy/interpreter/astcompiler/symtable.py 
b/pypy/interpreter/astcompiler/symtable.py
--- a/pypy/interpreter/astcompiler/symtable.py
+++ b/pypy/interpreter/astcompiler/symtable.py
@@ -135,7 +135,8 @@
                 err = "no binding for nonlocal '%s' found" % (name,)
                 raise SyntaxError(err, self.lineno, self.col_offset)
             self.symbols[name] = SCOPE_FREE
-            self.free_vars.append(name)
+            if not self._hide_bound_from_nested_scopes:
+                self.free_vars.append(name)
             free[name] = None
             self.has_free = True
         elif flags & SYM_BOUND:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to