Commit 3bda964e authored by Ezio Melotti's avatar Ezio Melotti

#14161: fix compile error under Windows.

parent 2bfc25f6
...@@ -639,8 +639,9 @@ file_repr(PyFileObject *f) ...@@ -639,8 +639,9 @@ file_repr(PyFileObject *f)
PyObject *name = NULL; PyObject *name = NULL;
if (PyUnicode_Check(f->f_name)) { if (PyUnicode_Check(f->f_name)) {
#ifdef Py_USING_UNICODE #ifdef Py_USING_UNICODE
const char *name_str;
name = PyUnicode_AsUnicodeEscapeString(f->f_name); name = PyUnicode_AsUnicodeEscapeString(f->f_name);
const char *name_str = name ? PyString_AsString(name) : "?"; name_str = name ? PyString_AsString(name) : "?";
ret = PyString_FromFormat("<%s file u'%s', mode '%s' at %p>", ret = PyString_FromFormat("<%s file u'%s', mode '%s' at %p>",
f->f_fp == NULL ? "closed" : "open", f->f_fp == NULL ? "closed" : "open",
name_str, name_str,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment