summaryrefslogtreecommitdiffstats
path: root/Objects/codeobject.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-10-10 13:55:14 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-10-10 13:55:14 (GMT)
commit7c74de4d00dc29143302bd2f718b3e3b04dafe9b (patch)
tree49bdbb1783835575919d09c8c3b1ac674e3c190c /Objects/codeobject.c
parent088cbf2d390f6caeb021f05909e1d0b2e506b332 (diff)
downloadcpython-7c74de4d00dc29143302bd2f718b3e3b04dafe9b.zip
cpython-7c74de4d00dc29143302bd2f718b3e3b04dafe9b.tar.gz
cpython-7c74de4d00dc29143302bd2f718b3e3b04dafe9b.tar.bz2
Issue #18874: PyCode_New() now ensures that the filename is a ready Unicode
string. This change does nothing is most cases, but it is useful on Windows in some cases.
Diffstat (limited to 'Objects/codeobject.c')
-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);