Skip to content

Commit

Permalink
Use importlib instead of imp.
Browse files Browse the repository at this point in the history
  • Loading branch information
dumol committed Oct 4, 2024
1 parent 46b3f64 commit df9c125
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pavement.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit df9c125

Please sign in to comment.