summaryrefslogtreecommitdiff
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorMark Dickinson <mdickinson@enthought.com>2012-11-18 10:42:42 +0000
committerMark Dickinson <mdickinson@enthought.com>2012-11-18 10:42:42 +0000
commit2e2651edeaf7a5a02e249147d36af573ce1ae6f8 (patch)
tree91762059f6781f06f0838947afd632f532416ff2 /Python/sysmodule.c
parentef6a13f37d15a322940c88d8884199e0ba8ccbb1 (diff)
parent43dab9533424996db42b4496f4e92944aca5b783 (diff)
downloadcpython-2e2651edeaf7a5a02e249147d36af573ce1ae6f8.tar.gz
Merge typo fix from 3.3.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 20bfa555b3..cafbb58667 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));