diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2024-05-06 09:02:37 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-06 09:02:37 (GMT) |
commit | 153b3f75306b5d26e29ea157105d0fdc247ef853 (patch) | |
tree | f73ede56af175d27698ef56bec21073f98889bbc /Lib/importlib | |
parent | 716ec4bfcf1a564db9936122c442baa99f9c4a8c (diff) | |
download | cpython-153b3f75306b5d26e29ea157105d0fdc247ef853.zip cpython-153b3f75306b5d26e29ea157105d0fdc247ef853.tar.gz cpython-153b3f75306b5d26e29ea157105d0fdc247ef853.tar.bz2 |
gh-118465: Add __firstlineno__ attribute to class (GH-118475)
It is set by compiler with the line number of the first line of
the class definition.
Diffstat (limited to 'Lib/importlib')
-rw-r--r-- | Lib/importlib/_bootstrap_external.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index 0a11dc9..30a8cd4 100644 --- a/Lib/importlib/_bootstrap_external.py +++ b/Lib/importlib/_bootstrap_external.py @@ -471,6 +471,7 @@ _code_type = type(_write_atomic.__code__) # Python 3.13a1 3567 (Reimplement line number propagation by the compiler) # Python 3.13a1 3568 (Change semantics of END_FOR) # Python 3.13a5 3569 (Specialize CONTAINS_OP) +# Python 3.13a6 3570 (Add __firstlineno__ class attribute) # Python 3.14 will start with 3600 @@ -487,7 +488,7 @@ _code_type = type(_write_atomic.__code__) # Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array # in PC/launcher.c must also be updated. -MAGIC_NUMBER = (3569).to_bytes(2, 'little') + b'\r\n' +MAGIC_NUMBER = (3570).to_bytes(2, 'little') + b'\r\n' _RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little') # For import.c |