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

Skip to content

Commit 0f2d4b8

Browse files
committed
PySymtableEntry_New(): I'm not sure what this routine is doing, but it
was obviously leaking an int object when whatever the heck it's looking for was found. Repaired that. This accounts for why entering function and class definitions at an interactive prompt leaked a reference to the integer 1 each time. Bugfix candidate.
1 parent 1464839 commit 0f2d4b8

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Python/symtable.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ PySymtableEntry_New(struct symtable *st, char *name, int type, int lineno)
1515
goto fail;
1616
v = PyDict_GetItem(st->st_symbols, k);
1717
if (v) /* XXX could check that name, type, lineno match */ {
18+
Py_DECREF(k);
1819
Py_INCREF(v);
1920
return v;
2021
}

0 commit comments

Comments
 (0)