Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fdf65ad

Browse files
committed
Use compiler_addop_o
1 parent bb2df61 commit fdf65ad

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

Python/compile.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2426,12 +2426,8 @@ compiler_class_body(struct compiler *c, stmt_ty s, int firstlineno)
24262426
// STORE_DEREF in a class namespace, and compiler_nameop() won't do
24272427
// that by default.
24282428
PyObject *cellvars = c->u->u_metadata.u_cellvars;
2429-
int arg = dict_add_o(cellvars, &_Py_ID(__classdict__));
2430-
if (arg < 0) {
2431-
compiler_exit_scope(c);
2432-
return ERROR;
2433-
}
2434-
if (codegen_addop_i(INSTR_SEQUENCE(c), STORE_DEREF, arg, loc) < 0) {
2429+
if (compiler_addop_o(c->u, loc, STORE_DEREF, cellvars,
2430+
&_Py_ID(__classdict__)) < 0) {
24352431
compiler_exit_scope(c);
24362432
return ERROR;
24372433
}

0 commit comments

Comments
 (0)