summaryrefslogtreecommitdiff
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2012-11-10 15:13:20 -0800
committerGregory P. Smith <greg@krypto.org>2012-11-10 15:13:20 -0800
commitba4bab5e5e33be325055cd24f13cf6b8cafc70e9 (patch)
tree707e4abeeffa0acf0ab39c99b1afb92cffe537ab /Python/sysmodule.c
parent6036726804846afff30398bc8f5a9d9fd286924c (diff)
parentb95b5efc8d6714b0ef39fe0743203c608a9467a8 (diff)
downloadcpython-ba4bab5e5e33be325055cd24f13cf6b8cafc70e9.tar.gz
Fix test_urllib broken by my previous commits. The assumptions it was
testing were added as part of the issue10050 change that caused the wrong behavior in the first place. now all test cases agree on the behavior.
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));