Skip to content

Commit

Permalink
Merge pull request #81 from hamarituc/py3.12
Browse files Browse the repository at this point in the history
Remove deprecated `imp` module
  • Loading branch information
vstinner authored Nov 5, 2023
2 parents b7e78e4 + 80e0c97 commit 68ed63b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# - git commit -a -m "post-release"
# - git push

from imp import load_source
import importlib.util
from os import path
try:
# setuptools supports bdist_wheel
Expand All @@ -55,7 +55,10 @@
with open('README.rst') as fp:
LONG_DESCRIPTION = fp.read()

ptrace = load_source("version", path.join("ptrace", "version.py"))
ptrace_spec = importlib.util.spec_from_file_location("version", path.join("ptrace", "version.py"))
ptrace = importlib.util.module_from_spec(ptrace_spec)
ptrace_spec.loader.exec_module(ptrace)

PACKAGES = {}
for name in MODULES:
PACKAGES[name] = name.replace(".", "/")
Expand Down

0 comments on commit 68ed63b

Please sign in to comment.