mirror of
https://github.com/python/cpython.git
synced 2025-08-28 12:45:07 +00:00
Fix refleak if from __future__ import was not first
This commit is contained in:
parent
814e938d08
commit
d9cf85f421
1 changed files with 1 additions and 0 deletions
|
@ -2529,6 +2529,7 @@ compiler_from_import(struct compiler *c, stmt_ty s)
|
||||||
if (s->lineno > c->c_future->ff_lineno) {
|
if (s->lineno > c->c_future->ff_lineno) {
|
||||||
if (!strcmp(PyString_AS_STRING(s->v.ImportFrom.module),
|
if (!strcmp(PyString_AS_STRING(s->v.ImportFrom.module),
|
||||||
"__future__")) {
|
"__future__")) {
|
||||||
|
Py_DECREF(level);
|
||||||
Py_DECREF(names);
|
Py_DECREF(names);
|
||||||
return compiler_error(c,
|
return compiler_error(c,
|
||||||
"from __future__ imports must occur "
|
"from __future__ imports must occur "
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue