diff --git a/pavement.py b/pavement.py index 0364f48..b84b011 100644 --- a/pavement.py +++ b/pavement.py @@ -119,8 +119,8 @@ def compile_file(fullname, ddir=None, force=0, rx=None, quiet=0): if not force: try: mtime = int(os.stat(fullname).st_mtime) - expect = struct.pack('<4sl', imp.get_magic(), mtime) - cfile = fullname + (__debug__ and 'c' or 'o') + expect = struct.pack('<4sl', importlib.util.MAGIC_NUMBER, mtime) + cfile = fullname + ('c' if __debug__ else 'o') with open(cfile, 'rb') as chandle: actual = chandle.read(8) if expect == actual: