--- ./py-compile_orig	2025-11-06 01:05:31.988117270 -0600
+++ ./py-compile	2025-11-06 02:49:33.748117181 -0600
@@ -116,7 +116,7 @@
 fi
 
 $PYTHON -c "
-import sys, os, py_compile, imp
+import sys, os, py_compile, importlib
 
 files = '''$files'''
 
@@ -129,15 +129,15 @@
 	    continue
     sys.stdout.write(file)
     sys.stdout.flush()
-    if hasattr(imp, 'get_tag'):
-        py_compile.compile(filepath, imp.cache_from_source(filepath), path)
+    if hasattr(sys, 'implementation.cache_tag'):
+        py_compile.compile(filepath, importlib.util.cache_from_source(filepath), path)
     else:
         py_compile.compile(filepath, filepath + 'c', path)
 sys.stdout.write('\n')" || exit $?
 
 # this will fail for python < 1.5, but that doesn't matter ...
 $PYTHON -O -c "
-import sys, os, py_compile, imp
+import sys, os, py_compile, importlib
 
 # pypy does not use .pyo optimization
 if hasattr(sys, 'pypy_translation_info'):
@@ -153,8 +153,8 @@
 	    continue
     sys.stdout.write(file)
     sys.stdout.flush()
-    if hasattr(imp, 'get_tag'):
-        py_compile.compile(filepath, imp.cache_from_source(filepath, False), path)
+    if hasattr(sys, 'implementation.cache_tag'):
+        py_compile.compile(filepath, importlib.util.cache_from_source(filepath, False), path)
     else:
         py_compile.compile(filepath, filepath + 'o', path)
 sys.stdout.write('\n')" 2>/dev/null || :
