]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix --disable-unicode compilation problems.
authorMartin v. Löwis <martin@v.loewis.de>
Thu, 21 Nov 2002 23:52:35 +0000 (23:52 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Thu, 21 Nov 2002 23:52:35 +0000 (23:52 +0000)
Modules/posixmodule.c
Objects/fileobject.c

index 04a0611de91229f12dea23bdf8fa68277ac34d06..fd7f69f6b1f2debb76d99f7e658c7b23e484242b 100644 (file)
@@ -22,6 +22,11 @@ standardized by the C Standard and the POSIX standard (a thinly\n\
 disguised Unix interface).  Refer to the library manual and\n\
 corresponding Unix manual entries for more information on calls.");
 
+#ifndef Py_USING_UNICODE
+/* This is used in signatures of functions. */
+#define Py_UNICODE void
+#endif
+
 #if defined(PYOS_OS2)
 #define  INCL_DOS
 #define  INCL_DOSERRORS
index ebf0d40d4200221d52b1ef852e6f1aa64568f471..b6c88dbf229f3923e6fe8a6fe67eb9d16f766f98 100644 (file)
@@ -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",