diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2002-11-21 23:52:35 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2002-11-21 23:52:35 (GMT) |
commit | 0073f2e42865766d1de6472b49a9181cef49a4d9 (patch) | |
tree | 3e526906bbc283cbc41f6b0d8632b65dd61e6a10 /Objects/fileobject.c | |
parent | ceeb9627c10b9dba868fbbff21f1ee09c80b9059 (diff) | |
download | cpython-0073f2e42865766d1de6472b49a9181cef49a4d9.zip cpython-0073f2e42865766d1de6472b49a9181cef49a4d9.tar.gz cpython-0073f2e42865766d1de6472b49a9181cef49a4d9.tar.bz2 |
Fix --disable-unicode compilation problems.
Diffstat (limited to 'Objects/fileobject.c')
-rw-r--r-- | Objects/fileobject.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c index ebf0d40..b6c88db 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -116,9 +116,11 @@ fill_file_fields(PyFileObject *f, FILE *fp, char *name, char *mode, Py_DECREF(f->f_name); Py_DECREF(f->f_mode); +#ifdef Py_USING_UNICODE if (wname) f->f_name = PyUnicode_FromObject(wname); else +#endif f->f_name = PyString_FromString(name); f->f_mode = PyString_FromString(mode); @@ -329,6 +331,7 @@ static PyObject * file_repr(PyFileObject *f) { if (PyUnicode_Check(f->f_name)) { +#ifdef Py_USING_UNICODE PyObject *ret = NULL; PyObject *name; name = PyUnicode_AsUnicodeEscapeString(f->f_name); @@ -339,6 +342,7 @@ file_repr(PyFileObject *f) f); Py_XDECREF(name); return ret; +#endif } else { return PyString_FromFormat("<%s file '%s', mode '%s' at %p>", f->f_fp == NULL ? "closed" : "open", |