Mercurial > cpython-lru_cache-weakref
comparison Python/pythonrun.c @ 43866:8ed0280c2ab6
Replace PyObject_Unicode with PyObject_Str everywhere, and remove the
#define for PyObject_Unicode in object.h.
| author | Thomas Heller <theller@ctypes.org> |
|---|---|
| date | Thu, 15 Nov 2007 20:48:54 +0000 |
| parents | ee081609cee8 |
| children | 00048fedbaa0 |
comparison
equal
deleted
inserted
replaced
| 43864:f4a3b4e155c2 | 43866:8ed0280c2ab6 |
|---|---|
| 909 return -1; | 909 return -1; |
| 910 enc = PyUnicode_AsString(oenc); | 910 enc = PyUnicode_AsString(oenc); |
| 911 } | 911 } |
| 912 v = PySys_GetObject("ps1"); | 912 v = PySys_GetObject("ps1"); |
| 913 if (v != NULL) { | 913 if (v != NULL) { |
| 914 v = PyObject_Unicode(v); | 914 v = PyObject_Str(v); |
| 915 if (v == NULL) | 915 if (v == NULL) |
| 916 PyErr_Clear(); | 916 PyErr_Clear(); |
| 917 else if (PyUnicode_Check(v)) | 917 else if (PyUnicode_Check(v)) |
| 918 ps1 = PyUnicode_AsString(v); | 918 ps1 = PyUnicode_AsString(v); |
| 919 } | 919 } |
| 920 w = PySys_GetObject("ps2"); | 920 w = PySys_GetObject("ps2"); |
| 921 if (w != NULL) { | 921 if (w != NULL) { |
| 922 w = PyObject_Unicode(w); | 922 w = PyObject_Str(w); |
| 923 if (w == NULL) | 923 if (w == NULL) |
| 924 PyErr_Clear(); | 924 PyErr_Clear(); |
| 925 else if (PyUnicode_Check(w)) | 925 else if (PyUnicode_Check(w)) |
| 926 ps2 = PyUnicode_AsString(w); | 926 ps2 = PyUnicode_AsString(w); |
| 927 } | 927 } |
| 1371 } | 1371 } |
| 1372 } | 1372 } |
| 1373 else | 1373 else |
| 1374 err = PyFile_WriteObject(exception, f, Py_PRINT_RAW); | 1374 err = PyFile_WriteObject(exception, f, Py_PRINT_RAW); |
| 1375 if (err == 0 && (value != Py_None)) { | 1375 if (err == 0 && (value != Py_None)) { |
| 1376 PyObject *s = PyObject_Unicode(value); | 1376 PyObject *s = PyObject_Str(value); |
| 1377 /* only print colon if the str() of the | 1377 /* only print colon if the str() of the |
| 1378 object is not the empty string | 1378 object is not the empty string |
| 1379 */ | 1379 */ |
| 1380 if (s == NULL) | 1380 if (s == NULL) |
| 1381 err = -1; | 1381 err = -1; |
| 1685 break; | 1685 break; |
| 1686 case E_DECODE: { | 1686 case E_DECODE: { |
| 1687 PyObject *type, *value, *tb; | 1687 PyObject *type, *value, *tb; |
| 1688 PyErr_Fetch(&type, &value, &tb); | 1688 PyErr_Fetch(&type, &value, &tb); |
| 1689 if (value != NULL) { | 1689 if (value != NULL) { |
| 1690 u = PyObject_Unicode(value); | 1690 u = PyObject_Str(value); |
| 1691 if (u != NULL) { | 1691 if (u != NULL) { |
| 1692 msg = PyUnicode_AsString(u); | 1692 msg = PyUnicode_AsString(u); |
| 1693 } | 1693 } |
| 1694 } | 1694 } |
| 1695 if (msg == NULL) | 1695 if (msg == NULL) |
