diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-01-25 02:31:39 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-01-25 02:31:39 (GMT) |
commit | 0e5fd59a27925ee5387717f3ed1f8ca2f3d64cbc (patch) | |
tree | 1f91cbabeaa9d65b02dc4d32ea4408db2eede719 | |
parent | 6e16f53855d16acb9233e09a219f28b06e2c7925 (diff) | |
download | cpython-0e5fd59a27925ee5387717f3ed1f8ca2f3d64cbc.zip cpython-0e5fd59a27925ee5387717f3ed1f8ca2f3d64cbc.tar.gz cpython-0e5fd59a27925ee5387717f3ed1f8ca2f3d64cbc.tar.bz2 |
Make guard more dynamic (apparently the size of a filesystem timestamp may vary under Windows).
-rw-r--r-- | Python/import.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Python/import.c b/Python/import.c index 0e82390..9876aad 100644 --- a/Python/import.c +++ b/Python/import.c @@ -979,14 +979,14 @@ load_source_module(char *name, char *pathname, FILE *fp) pathname); return NULL; } -#if SIZEOF_TIME_T > 4 - /* Python's .pyc timestamp handling presumes that the timestamp fits - in 4 bytes. Since the code only does an equality comparison, - ordering is not important and we can safely ignore the higher bits - (collisions are extremely unlikely). - */ - st.st_mtime &= 0xFFFFFFFF; -#endif + if (sizeof st.st_mtime > 4) { + /* Python's .pyc timestamp handling presumes that the timestamp fits + in 4 bytes. Since the code only does an equality comparison, + ordering is not important and we can safely ignore the higher bits + (collisions are extremely unlikely). + */ + st.st_mtime &= 0xFFFFFFFF; + } cpathname = make_compiled_pathname(pathname, buf, (size_t)MAXPATHLEN + 1); if (cpathname != NULL && |