check local class namespace before reaching for cells (closes #17853)

This commit is contained in:
Benjamin Peterson 2013-04-30 09:41:40 -04:00
parent f256f5f3eb
commit 3b0431dc60
10 changed files with 187 additions and 122 deletions

View file

@ -388,12 +388,14 @@ def _call_with_frames_removed(f, *args, **kwds):
# Python 3.3a4 3230 (revert changes to implicit __class__ closure)
# Python 3.4a1 3250 (evaluate positional default arguments before
# keyword-only defaults)
# Python 3.4a1 3260 (add LOAD_CLASSDEREF; allow locals of class to override
# free vars)
#
# MAGIC must change whenever the bytecode emitted by the compiler may no
# longer be understood by older implementations of the eval loop (usually
# due to the addition of new opcodes).
_MAGIC_BYTES = (3250).to_bytes(2, 'little') + b'\r\n'
_MAGIC_BYTES = (3260).to_bytes(2, 'little') + b'\r\n'
_RAW_MAGIC_NUMBER = int.from_bytes(_MAGIC_BYTES, 'little')
_PYCACHE = '__pycache__'