Mercurial > cpython-lru_cache-weakref
comparison Python/sysmodule.c @ 20943:e4d380f5f297 legacy-trunk
Include sys_getdefaultencoding in #ifdef Py_USING_UNICODE. Fixes #479571.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Fri, 09 Nov 2001 20:59:39 +0000 |
| parents | 7344687bf2c0 |
| children | 47f6533674fd |
comparison
equal
deleted
inserted
replaced
| 20942:d3dd0c2a1771 | 20943:e4d380f5f297 |
|---|---|
| 162 If the status is omitted or None, it defaults to zero (i.e., success).\n\ | 162 If the status is omitted or None, it defaults to zero (i.e., success).\n\ |
| 163 If the status numeric, it will be used as the system exit status.\n\ | 163 If the status numeric, it will be used as the system exit status.\n\ |
| 164 If it is another kind of object, it will be printed and the system\n\ | 164 If it is another kind of object, it will be printed and the system\n\ |
| 165 exit status will be one (i.e., failure)."; | 165 exit status will be one (i.e., failure)."; |
| 166 | 166 |
| 167 #ifdef Py_USING_UNICODE | |
| 168 | |
| 167 static PyObject * | 169 static PyObject * |
| 168 sys_getdefaultencoding(PyObject *self) | 170 sys_getdefaultencoding(PyObject *self) |
| 169 { | 171 { |
| 170 return PyString_FromString(PyUnicode_GetDefaultEncoding()); | 172 return PyString_FromString(PyUnicode_GetDefaultEncoding()); |
| 171 } | 173 } |
| 173 static char getdefaultencoding_doc[] = | 175 static char getdefaultencoding_doc[] = |
| 174 "getdefaultencoding() -> string\n\ | 176 "getdefaultencoding() -> string\n\ |
| 175 \n\ | 177 \n\ |
| 176 Return the current default string encoding used by the Unicode \n\ | 178 Return the current default string encoding used by the Unicode \n\ |
| 177 implementation."; | 179 implementation."; |
| 178 | |
| 179 #ifdef Py_USING_UNICODE | |
| 180 | 180 |
| 181 static PyObject * | 181 static PyObject * |
| 182 sys_setdefaultencoding(PyObject *self, PyObject *args) | 182 sys_setdefaultencoding(PyObject *self, PyObject *args) |
| 183 { | 183 { |
| 184 char *encoding; | 184 char *encoding; |
