mirror of
https://github.com/python/cpython.git
synced 2025-08-09 11:29:45 +00:00
[3.12] gh-109195: fix source location for super load before LOAD_SUPER_ATTR (GH-109289) (#109291)
gh-109195: fix source location for super load before LOAD_SUPER_ATTR (GH-109289)
(cherry picked from commit ceeb4173ae
)
Co-authored-by: Carl Meyer <carl@oddbird.net>
This commit is contained in:
parent
8e96b98282
commit
2004e12d8d
3 changed files with 12 additions and 1 deletions
|
@ -1742,6 +1742,13 @@ class TestSourcePositions(unittest.TestCase):
|
|||
list(code.co_consts[1].co_positions()),
|
||||
)
|
||||
|
||||
def test_load_super_attr(self):
|
||||
source = "class C:\n def __init__(self):\n super().__init__()"
|
||||
code = compile(source, "<test>", "exec").co_consts[0].co_consts[1]
|
||||
self.assertOpcodeSourcePositionIs(
|
||||
code, "LOAD_GLOBAL", line=3, end_line=3, column=4, end_column=9
|
||||
)
|
||||
|
||||
|
||||
class TestExpressionStackSize(unittest.TestCase):
|
||||
# These tests check that the computed stack size for a code object
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue