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

Skip to content

Commit d9cf85f

Browse files
committed
Fix refleak if from __future__ import was not first
1 parent 814e938 commit d9cf85f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Python/compile.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2529,6 +2529,7 @@ compiler_from_import(struct compiler *c, stmt_ty s)
25292529
if (s->lineno > c->c_future->ff_lineno) {
25302530
if (!strcmp(PyString_AS_STRING(s->v.ImportFrom.module),
25312531
"__future__")) {
2532+
Py_DECREF(level);
25322533
Py_DECREF(names);
25332534
return compiler_error(c,
25342535
"from __future__ imports must occur "

0 commit comments

Comments
 (0)