hide the __class__ closure from the class body (#12370)

This commit is contained in:
Benjamin Peterson 2013-05-15 15:26:42 -05:00
parent fe361dfab5
commit 312595ce3a
7 changed files with 221 additions and 152 deletions

View file

@ -390,12 +390,13 @@ def _call_with_frames_removed(f, *args, **kwds):
# keyword-only defaults)
# Python 3.4a1 3260 (add LOAD_CLASSDEREF; allow locals of class to override
# free vars)
# Python 3.4a1 3270 (various tweaks to the __class_ closure)
#
# 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 = (3260).to_bytes(2, 'little') + b'\r\n'
_MAGIC_BYTES = (3270).to_bytes(2, 'little') + b'\r\n'
_RAW_MAGIC_NUMBER = int.from_bytes(_MAGIC_BYTES, 'little')
_PYCACHE = '__pycache__'