Mercurial > cpython-lru_cache-weakref
comparison Python/sysmodule.c @ 41587:15b810e21fe9
Get rid of all #ifdef Py_USING_UNICODE (it is always present now).
(With the help of unifdef from freshmeat.)
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 03 May 2007 17:49:24 +0000 |
| parents | 06145fbc7ab9 |
| children | 308e632702bf |
comparison
equal
deleted
inserted
replaced
| 41586:368fed9af761 | 41587:15b810e21fe9 |
|---|---|
| 208 If the status is numeric, it will be used as the system exit status.\n\ | 208 If the status is numeric, it will be used as the system exit status.\n\ |
| 209 If it is another kind of object, it will be printed and the system\n\ | 209 If it is another kind of object, it will be printed and the system\n\ |
| 210 exit status will be one (i.e., failure)." | 210 exit status will be one (i.e., failure)." |
| 211 ); | 211 ); |
| 212 | 212 |
| 213 #ifdef Py_USING_UNICODE | |
| 214 | 213 |
| 215 static PyObject * | 214 static PyObject * |
| 216 sys_getdefaultencoding(PyObject *self) | 215 sys_getdefaultencoding(PyObject *self) |
| 217 { | 216 { |
| 218 return PyString_FromString(PyUnicode_GetDefaultEncoding()); | 217 return PyString_FromString(PyUnicode_GetDefaultEncoding()); |
| 257 \n\ | 256 \n\ |
| 258 Return the encoding used to convert Unicode filenames in\n\ | 257 Return the encoding used to convert Unicode filenames in\n\ |
| 259 operating system filenames." | 258 operating system filenames." |
| 260 ); | 259 ); |
| 261 | 260 |
| 262 #endif | |
| 263 | 261 |
| 264 | 262 |
| 265 static PyObject * | 263 static PyObject * |
| 266 sys_intern(PyObject *self, PyObject *args) | 264 sys_intern(PyObject *self, PyObject *args) |
| 267 { | 265 { |
| 761 {"displayhook", sys_displayhook, METH_O, displayhook_doc}, | 759 {"displayhook", sys_displayhook, METH_O, displayhook_doc}, |
| 762 {"exc_info", sys_exc_info, METH_NOARGS, exc_info_doc}, | 760 {"exc_info", sys_exc_info, METH_NOARGS, exc_info_doc}, |
| 763 {"exc_clear", sys_exc_clear, METH_NOARGS, exc_clear_doc}, | 761 {"exc_clear", sys_exc_clear, METH_NOARGS, exc_clear_doc}, |
| 764 {"excepthook", sys_excepthook, METH_VARARGS, excepthook_doc}, | 762 {"excepthook", sys_excepthook, METH_VARARGS, excepthook_doc}, |
| 765 {"exit", sys_exit, METH_VARARGS, exit_doc}, | 763 {"exit", sys_exit, METH_VARARGS, exit_doc}, |
| 766 #ifdef Py_USING_UNICODE | |
| 767 {"getdefaultencoding", (PyCFunction)sys_getdefaultencoding, | 764 {"getdefaultencoding", (PyCFunction)sys_getdefaultencoding, |
| 768 METH_NOARGS, getdefaultencoding_doc}, | 765 METH_NOARGS, getdefaultencoding_doc}, |
| 769 #endif | |
| 770 #ifdef HAVE_DLOPEN | 766 #ifdef HAVE_DLOPEN |
| 771 {"getdlopenflags", (PyCFunction)sys_getdlopenflags, METH_NOARGS, | 767 {"getdlopenflags", (PyCFunction)sys_getdlopenflags, METH_NOARGS, |
| 772 getdlopenflags_doc}, | 768 getdlopenflags_doc}, |
| 773 #endif | 769 #endif |
| 774 #ifdef COUNT_ALLOCS | 770 #ifdef COUNT_ALLOCS |
| 775 {"getcounts", (PyCFunction)sys_getcounts, METH_NOARGS}, | 771 {"getcounts", (PyCFunction)sys_getcounts, METH_NOARGS}, |
| 776 #endif | 772 #endif |
| 777 #ifdef DYNAMIC_EXECUTION_PROFILE | 773 #ifdef DYNAMIC_EXECUTION_PROFILE |
| 778 {"getdxp", _Py_GetDXProfile, METH_VARARGS}, | 774 {"getdxp", _Py_GetDXProfile, METH_VARARGS}, |
| 779 #endif | 775 #endif |
| 780 #ifdef Py_USING_UNICODE | |
| 781 {"getfilesystemencoding", (PyCFunction)sys_getfilesystemencoding, | 776 {"getfilesystemencoding", (PyCFunction)sys_getfilesystemencoding, |
| 782 METH_NOARGS, getfilesystemencoding_doc}, | 777 METH_NOARGS, getfilesystemencoding_doc}, |
| 783 #endif | |
| 784 #ifdef Py_TRACE_REFS | 778 #ifdef Py_TRACE_REFS |
| 785 {"getobjects", _Py_GetObjects, METH_VARARGS}, | 779 {"getobjects", _Py_GetObjects, METH_VARARGS}, |
| 786 #endif | 780 #endif |
| 787 #ifdef Py_REF_DEBUG | 781 #ifdef Py_REF_DEBUG |
| 788 {"gettotalrefcount", (PyCFunction)sys_gettotalrefcount, METH_NOARGS}, | 782 {"gettotalrefcount", (PyCFunction)sys_gettotalrefcount, METH_NOARGS}, |
| 797 #endif /* MS_WINDOWS */ | 791 #endif /* MS_WINDOWS */ |
| 798 {"intern", sys_intern, METH_VARARGS, intern_doc}, | 792 {"intern", sys_intern, METH_VARARGS, intern_doc}, |
| 799 #ifdef USE_MALLOPT | 793 #ifdef USE_MALLOPT |
| 800 {"mdebug", sys_mdebug, METH_VARARGS}, | 794 {"mdebug", sys_mdebug, METH_VARARGS}, |
| 801 #endif | 795 #endif |
| 802 #ifdef Py_USING_UNICODE | |
| 803 {"setdefaultencoding", sys_setdefaultencoding, METH_VARARGS, | 796 {"setdefaultencoding", sys_setdefaultencoding, METH_VARARGS, |
| 804 setdefaultencoding_doc}, | 797 setdefaultencoding_doc}, |
| 805 #endif | |
| 806 {"setcheckinterval", sys_setcheckinterval, METH_VARARGS, | 798 {"setcheckinterval", sys_setcheckinterval, METH_VARARGS, |
| 807 setcheckinterval_doc}, | 799 setcheckinterval_doc}, |
| 808 {"getcheckinterval", sys_getcheckinterval, METH_NOARGS, | 800 {"getcheckinterval", sys_getcheckinterval, METH_NOARGS, |
| 809 getcheckinterval_doc}, | 801 getcheckinterval_doc}, |
| 810 #ifdef HAVE_DLOPEN | 802 #ifdef HAVE_DLOPEN |
| 1182 PyString_FromString(Py_GetPrefix())); | 1174 PyString_FromString(Py_GetPrefix())); |
| 1183 SET_SYS_FROM_STRING("exec_prefix", | 1175 SET_SYS_FROM_STRING("exec_prefix", |
| 1184 PyString_FromString(Py_GetExecPrefix())); | 1176 PyString_FromString(Py_GetExecPrefix())); |
| 1185 SET_SYS_FROM_STRING("maxint", | 1177 SET_SYS_FROM_STRING("maxint", |
| 1186 PyInt_FromLong(PyInt_GetMax())); | 1178 PyInt_FromLong(PyInt_GetMax())); |
| 1187 #ifdef Py_USING_UNICODE | |
| 1188 SET_SYS_FROM_STRING("maxunicode", | 1179 SET_SYS_FROM_STRING("maxunicode", |
| 1189 PyInt_FromLong(PyUnicode_GetMax())); | 1180 PyInt_FromLong(PyUnicode_GetMax())); |
| 1190 #endif | |
| 1191 SET_SYS_FROM_STRING("builtin_module_names", | 1181 SET_SYS_FROM_STRING("builtin_module_names", |
| 1192 list_builtin_module_names()); | 1182 list_builtin_module_names()); |
| 1193 { | 1183 { |
| 1194 /* Assumes that longs are at least 2 bytes long. | 1184 /* Assumes that longs are at least 2 bytes long. |
| 1195 Should be safe! */ | 1185 Should be safe! */ |
