summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index eead707b54..70872222eb 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -515,8 +515,7 @@ parse_syntax_error(PyObject *err, PyObject **message, PyObject **filename,
if (v == Py_None) {
Py_DECREF(v);
_Py_DECLARE_STR(anon_string, "<string>");
- *filename = &_Py_STR(anon_string);
- Py_INCREF(*filename);
+ *filename = Py_NewRef(&_Py_STR(anon_string));
}
else {
*filename = v;