#14161: fix compile error under Windows.

This commit is contained in:
Ezio Melotti 2012-03-12 01:28:45 +02:00
parent 11f8b6872a
commit eace3a7261
1 changed files with 2 additions and 1 deletions

View File

@ -639,8 +639,9 @@ file_repr(PyFileObject *f)
PyObject *name = NULL;
if (PyUnicode_Check(f->f_name)) {
#ifdef Py_USING_UNICODE
const char *name_str;
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>",
f->f_fp == NULL ? "closed" : "open",
name_str,