]> granicus.if.org Git - python/commitdiff
Automatic conversion of floats to integers for struct.pack integer codes
authorMark Dickinson <dickinsm@gmail.com>
Sun, 19 Apr 2009 17:10:47 +0000 (17:10 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Sun, 19 Apr 2009 17:10:47 +0000 (17:10 +0000)
is deprecated.  Use an explicit int() instead.

Lib/compileall.py

index f99b8340cff47619bb3734a3d2542555211ff4ce..49537fded0b9aa13fd4c6fc2fdd779542edd1717 100644 (file)
@@ -57,7 +57,7 @@ def compile_dir(dir, maxlevels=10, ddir=None,
             if tail == '.py':
                 if not force:
                     try:
-                        mtime = os.stat(fullname).st_mtime
+                        mtime = int(os.stat(fullname).st_mtime)
                         expect = struct.pack('<4sl', imp.get_magic(), mtime)
                         cfile = fullname + (__debug__ and 'c' or 'o')
                         with open(cfile, 'rb') as chandle: