diff options
author | Gregory P. Smith <greg@krypto.org> | 2012-11-10 21:10:31 -0800 |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2012-11-10 21:10:31 -0800 |
commit | 22f9e65bb11ab8dee2562fe5bf4e19dc9ff87bf7 (patch) | |
tree | b2ee3bf7504f2ef298b67d1e70b43138265fd626 /Python/sysmodule.c | |
parent | f6128db16b5187864ee8da2078d87bd52539fcad (diff) | |
parent | bbdd90ba3a4de0c56d65b1fcc6db37b2730119d6 (diff) | |
download | cpython-22f9e65bb11ab8dee2562fe5bf4e19dc9ff87bf7.tar.gz |
Fixes issue #14396: Handle the odd rare case of waitpid returning 0
when not expected in subprocess.Popen.wait().
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 23 |
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)); |