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 dae329d commit eebc02e
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 @@ -119,8 +119,12 @@ def write_version_py(filename='orangewidget/version.py'):
GIT_REVISION = git_version()
elif os.path.exists(filename):
# must be a source distribution, use existing version file
import imp
version = imp.load_source("orangewidget.version", filename)
import importlib.util
spec = importlib.util.spec_from_file_location(
"orangewidget.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 eebc02e

Please sign in to comment.