mirror of
https://github.com/python/cpython
synced 2024-09-25 05:21:48 +00:00
DECREF result of run_string
This commit is contained in:
parent
0b3449010e
commit
6b6e0aafe5
|
@ -782,7 +782,6 @@ eval_code(co, globals, locals, owner, arg)
|
||||||
u = w;
|
u = w;
|
||||||
w = gettupleitem(u, 0);
|
w = gettupleitem(u, 0);
|
||||||
INCREF(w);
|
INCREF(w);
|
||||||
INCREF(w);
|
|
||||||
DECREF(u);
|
DECREF(u);
|
||||||
}
|
}
|
||||||
if (is_stringobject(w)) {
|
if (is_stringobject(w)) {
|
||||||
|
@ -2657,6 +2656,7 @@ exec_statement(prog, globals, locals)
|
||||||
{
|
{
|
||||||
char *s;
|
char *s;
|
||||||
int n;
|
int n;
|
||||||
|
object *v;
|
||||||
|
|
||||||
if (is_tupleobject(prog) && globals == None && locals == None &&
|
if (is_tupleobject(prog) && globals == None && locals == None &&
|
||||||
((n = gettuplesize(prog)) == 2 || n == 3)) {
|
((n = gettuplesize(prog)) == 2 || n == 3)) {
|
||||||
|
@ -2705,7 +2705,8 @@ exec_statement(prog, globals, locals)
|
||||||
err_setstr(ValueError, "embedded '\\0' in exec string");
|
err_setstr(ValueError, "embedded '\\0' in exec string");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (run_string(s, file_input, globals, locals) == NULL)
|
if ((v = run_string(s, file_input, globals, locals)) == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
DECREF(v);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue