Skip to content

Commit 68ed63b

Browse files
authored
Merge pull request #81 from hamarituc/py3.12
Remove deprecated `imp` module
2 parents b7e78e4 + 80e0c97 commit 68ed63b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# - git commit -a -m "post-release"
2929
# - git push
3030

31-
from imp import load_source
31+
import importlib.util
3232
from os import path
3333
try:
3434
# setuptools supports bdist_wheel
@@ -55,7 +55,10 @@
5555
with open('README.rst') as fp:
5656
LONG_DESCRIPTION = fp.read()
5757

58-
ptrace = load_source("version", path.join("ptrace", "version.py"))
58+
ptrace_spec = importlib.util.spec_from_file_location("version", path.join("ptrace", "version.py"))
59+
ptrace = importlib.util.module_from_spec(ptrace_spec)
60+
ptrace_spec.loader.exec_module(ptrace)
61+
5962
PACKAGES = {}
6063
for name in MODULES:
6164
PACKAGES[name] = name.replace(".", "/")

0 commit comments

Comments
 (0)