Skip to content

Commit

Permalink
setup.py: Replace use of imp module
Browse files Browse the repository at this point in the history
  • Loading branch information
ales-erjavec committed Dec 22, 2023
1 parent dcd7f72 commit 2b1558a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,12 @@ def write_version_py(filename='Orange/version.py'):
GIT_REVISION = git_version()
elif os.path.exists('Orange/version.py'):
# must be a source distribution, use existing version file
import imp
version = imp.load_source("Orange.version", "Orange/version.py")
import importlib.util
spec = importlib.util.spec_from_file_location(
"Orange.version", filename
)
version = importlib.util.module_from_spec(spec)
spec.loader.exec_module(version)
GIT_REVISION = version.git_revision
else:
GIT_REVISION = "Unknown"
Expand Down

0 comments on commit 2b1558a

Please sign in to comment.