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

Skip to content

Commit 1526582

Browse files
committed
Partly revert ad3824a90261 and add comment about reference ownership
1 parent 79b97ee commit 1526582

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Python/symtable.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
3737
if (ste == NULL)
3838
goto fail;
3939
ste->ste_table = st;
40-
ste->ste_id = k;
40+
ste->ste_id = k; /* ste owns reference to k */
4141

4242
ste->ste_name = name;
4343
Py_INCREF(name);
@@ -83,7 +83,6 @@ ste_new(struct symtable *st, identifier name, _Py_block_ty block,
8383

8484
return ste;
8585
fail:
86-
Py_XDECREF(k);
8786
Py_XDECREF(ste);
8887
return NULL;
8988
}

0 commit comments

Comments
 (0)