Mercurial > cpython-lru_cache-weakref
diff Python/import.c @ 74605:0bec943f6778 2.7
Make guard more dynamic (apparently the size of a filesystem timestamp may vary under Windows).
| author | Antoine Pitrou <solipsis@pitrou.net> |
|---|---|
| date | Wed, 25 Jan 2012 03:31:39 +0100 |
| parents | 0499eed74126 |
| children | ae37ae1cace8 |
line wrap: on
line diff
--- a/Python/import.c Wed Jan 25 02:49:47 2012 +0100 +++ b/Python/import.c Wed Jan 25 03:31:39 2012 +0100 @@ -979,14 +979,14 @@ 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 &&
