give explicitly global functions and classes a global __qualname__ (closes #19301)

This commit is contained in:
Benjamin Peterson 2013-10-19 16:01:13 -04:00
parent 3586673703
commit 3d9e481ece
6 changed files with 3263 additions and 3453 deletions

View file

@ -369,12 +369,13 @@ def _call_with_frames_removed(f, *args, **kwds):
# free vars)
# Python 3.4a1 3270 (various tweaks to the __class__ closure)
# Python 3.4a1 3280 (remove implicit class argument)
# Python 3.4a4 3290 (changes to __qualname__ computation)
#
# 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_NUMBER = (3280).to_bytes(2, 'little') + b'\r\n'
MAGIC_NUMBER = (3290).to_bytes(2, 'little') + b'\r\n'
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c
_PYCACHE = '__pycache__'