Skip to content

Commit

Permalink
Issue #18874: PyCode_New() now ensures that the filename is a ready U…
Browse files Browse the repository at this point in the history
…nicode

string. This change does nothing is most cases, but it is useful on Windows in
some cases.
  • Loading branch information
vstinner committed Oct 10, 2013
1 parent 1349002 commit 73f4690
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Objects/codeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 73f4690

Please sign in to comment.