summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorTrent Nelson <trent@trent.me>2012-10-17 22:08:40 (GMT)
committerTrent Nelson <trent@trent.me>2012-10-17 22:08:40 (GMT)
commitf17512f67e545bfeda1905b63f80217e0b7853aa (patch)
treef88dd59d7d4b46c8063ec714dae0c99dbf3aeca6 /Python
parentc78649873fe76da34230bb8ee5284ff64b2af2e4 (diff)
parent743e0cd6b5d59767aae2524700857f188ca1e80e (diff)
downloadcpython-f17512f67e545bfeda1905b63f80217e0b7853aa.zip
cpython-f17512f67e545bfeda1905b63f80217e0b7853aa.tar.gz
cpython-f17512f67e545bfeda1905b63f80217e0b7853aa.tar.bz2
Merge heads.
Diffstat (limited to 'Python')
-rw-r--r--Python/sysmodule.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 20bfa55..cafbb58 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1561,7 +1561,6 @@ PyObject *
_PySys_Init(void)
{
PyObject *m, *v, *sysdict, *version_info;
- char *s;
m = PyModule_Create(&sysmodule);
if (m == NULL)
@@ -1638,20 +1637,14 @@ _PySys_Init(void)
PyLong_FromLong(0x10FFFF));
SET_SYS_FROM_STRING("builtin_module_names",
list_builtin_module_names());
- {
- /* Assumes that longs are at least 2 bytes long.
- Should be safe! */
- unsigned long number = 1;
- char *value;
-
- s = (char *) &number;
- if (s[0] == 0)
- value = "big";
- else
- value = "little";
- SET_SYS_FROM_STRING("byteorder",
- PyUnicode_FromString(value));
- }
+#if PY_BIG_ENDIAN
+ SET_SYS_FROM_STRING("byteorder",
+ PyUnicode_FromString("big"));
+#else
+ SET_SYS_FROM_STRING("byteorder",
+ PyUnicode_FromString("little"));
+#endif
+
#ifdef MS_COREDLL
SET_SYS_FROM_STRING("dllhandle",
PyLong_FromVoidPtr(PyWin_DLLhModule));