]> granicus.if.org Git - python/commitdiff
Make guard more dynamic (apparently the size of a filesystem timestamp may vary under...
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 25 Jan 2012 02:31:39 +0000 (03:31 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 25 Jan 2012 02:31:39 +0000 (03:31 +0100)
Python/import.c

index 0e823909b2892dd6d36f17eba36ff47a9c0b4daa..9876aad40070c9c7533539c9eecae2417eb17586 100644 (file)
@@ -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 &&