From: Ezio Melotti Date: Sun, 11 Mar 2012 23:28:45 +0000 (+0200) Subject: #14161: fix compile error under Windows. X-Git-Tag: v2.7.4rc1~978 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eace3a726146c9bd383d981f2b5c6add96f13632;p=python #14161: fix compile error under Windows. --- diff --git a/Objects/fileobject.c b/Objects/fileobject.c index 79b9aad4e8..050e239c4f 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -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,