From df9c125d81a127d840d2ec843d72a0e74717b0e9 Mon Sep 17 00:00:00 2001 From: dumol Date: Fri, 4 Oct 2024 13:51:19 +0000 Subject: [PATCH] Use importlib instead of imp. --- pavement.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: