Mercurial > cpython-lru_cache-weakref
diff Python/sysmodule.c @ 41981:c6a0b75dbec2
Change most sys attributes that were str8 objects into str objects
(executable, prefix and exec_prefix are still str8).
| author | Walter Dörwald <walter@livinglogic.de> |
|---|---|
| date | Thu, 07 Jun 2007 18:41:59 +0000 |
| parents | 9d02a4adf574 |
| children | cd125fe83051 |
line wrap: on
line diff
--- a/Python/sysmodule.c Thu Jun 07 17:54:36 2007 +0000 +++ b/Python/sysmodule.c Thu Jun 07 18:41:59 2007 +0000 @@ -1049,13 +1049,13 @@ PyDict_SetItemString(sysdict, "__excepthook__", PyDict_GetItemString(sysdict, "excepthook")); PyDict_SetItemString(sysdict, "version", - v = PyString_FromString(Py_GetVersion())); + v = PyUnicode_FromString(Py_GetVersion())); Py_XDECREF(v); PyDict_SetItemString(sysdict, "hexversion", v = PyInt_FromLong(PY_VERSION_HEX)); Py_XDECREF(v); svnversion_init(); - v = Py_BuildValue("(ssz)", "CPython", branch, svn_revision); + v = Py_BuildValue("(UUU)", "CPython", branch, svn_revision); PyDict_SetItemString(sysdict, "subversion", v); Py_XDECREF(v); /* @@ -1079,16 +1079,16 @@ Py_XDECREF(v) SET_SYS_FROM_STRING("version_info", - Py_BuildValue("iiisi", PY_MAJOR_VERSION, + Py_BuildValue("iiiUi", PY_MAJOR_VERSION, PY_MINOR_VERSION, PY_MICRO_VERSION, s, PY_RELEASE_SERIAL)); SET_SYS_FROM_STRING("api_version", PyInt_FromLong(PYTHON_API_VERSION)); SET_SYS_FROM_STRING("copyright", - PyString_FromString(Py_GetCopyright())); + PyUnicode_FromString(Py_GetCopyright())); SET_SYS_FROM_STRING("platform", - PyString_FromString(Py_GetPlatform())); + PyUnicode_FromString(Py_GetPlatform())); SET_SYS_FROM_STRING("executable", PyString_FromString(Py_GetProgramFullPath())); SET_SYS_FROM_STRING("prefix", @@ -1113,13 +1113,13 @@ else value = "little"; SET_SYS_FROM_STRING("byteorder", - PyString_FromString(value)); + PyUnicode_FromString(value)); } #ifdef MS_COREDLL SET_SYS_FROM_STRING("dllhandle", PyLong_FromVoidPtr(PyWin_DLLhModule)); SET_SYS_FROM_STRING("winver", - PyString_FromString(PyWin_DLLVersionString)); + PyUnicode_FromString(PyWin_DLLVersionString)); #endif #undef SET_SYS_FROM_STRING if (warnoptions == NULL) {
