Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eaa2883 commit 937114fCopy full SHA for 937114f
1 file changed
Python/pythonrun.c
@@ -1928,10 +1928,9 @@ print_exception(PyObject *f, PyObject *value)
1928
err = PyFile_WriteString("<unknown>", f);
1929
}
1930
else {
1931
- char* modstr = _PyUnicode_AsString(moduleName);
1932
- if (modstr && strcmp(modstr, "builtins"))
+ if (PyUnicode_CompareWithASCIIString(moduleName, "builtins") != 0)
1933
{
1934
- err = PyFile_WriteString(modstr, f);
+ err = PyFile_WriteObject(moduleName, f, Py_PRINT_RAW);
1935
err += PyFile_WriteString(".", f);
1936
1937
Py_DECREF(moduleName);
0 commit comments