summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/pythonrun.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index b915c06..db49916 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -1277,7 +1277,9 @@ run_mod(mod_ty mod, PyObject *filename, PyObject *globals, PyObject *locals,
PyCodeObject *co = _PyAST_Compile(mod, interactive_filename, flags, -1, arena);
if (co == NULL) {
- Py_DECREF(interactive_filename);
+ if (interactive_src) {
+ Py_DECREF(interactive_filename);
+ }
return NULL;
}