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
// load super() global
PyObject *super_name = e->v.Call.func->v.Name.id;
- RETURN_IF_ERROR(compiler_nameop(c, loc, super_name, Load));
+ RETURN_IF_ERROR(compiler_nameop(c, LOC(e->v.Call.func), super_name, Load));
if (asdl_seq_LEN(e->v.Call.args) == 2) {
VISIT(c, expr, asdl_seq_GET(e->v.Call.args, 0));