Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7c74de4

Browse files
committed
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.
1 parent 088cbf2 commit 7c74de4

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Objects/codeobject.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ PyCode_New(int argcount, int kwonlyargcount,
7474
PyErr_BadInternalCall();
7575
return NULL;
7676
}
77+
78+
/* Ensure that the filename is a ready Unicode string */
79+
if (PyUnicode_READY(filename) < 0)
80+
return NULL;
81+
7782
n_cellvars = PyTuple_GET_SIZE(cellvars);
7883
intern_strings(names);
7984
intern_strings(varnames);

0 commit comments

Comments
 (0)