diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2013-10-10 15:55:14 +0200 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2013-10-10 15:55:14 +0200 |
| commit | 7c74de4d00dc29143302bd2f718b3e3b04dafe9b (patch) | |
| tree | 49bdbb1783835575919d09c8c3b1ac674e3c190c /Objects/codeobject.c | |
| parent | 088cbf2d390f6caeb021f05909e1d0b2e506b332 (diff) | |
| download | cpython-git-7c74de4d00dc29143302bd2f718b3e3b04dafe9b.tar.gz | |
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.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 9713f61b24..353f414a38 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); |
