summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Objects/codeobject.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index 9713f61..353f414 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -74,6 +74,11 @@ PyCode_New(int argcount, int kwonlyargcount,
PyErr_BadInternalCall();
return NULL;
}
+
+ /* Ensure that the filename is a ready Unicode string */
+ if (PyUnicode_READY(filename) < 0)
+ return NULL;
+
n_cellvars = PyTuple_GET_SIZE(cellvars);
intern_strings(names);
intern_strings(varnames);