1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
From: Antonio Valentino <antonio.valentino@tiscali.it>
Date: Fri, 13 Sep 2024 06:19:28 +0000
Subject: Use importlib instead of the deprecated imp
Forwarded: https://github.com/bmcfee/resampy/pull/122
---
docs/conf.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/docs/conf.py b/docs/conf.py
index 4f6e078..02d9aea 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -63,8 +63,10 @@ sys.modules.update((mod_name, mock.Mock()) for mod_name in MOCK_MODULES)
# |version| and |release|, also used in various other places throughout the
# built documents.
#
-import imp
-resampy_version = imp.load_source('resampy.version', '../resampy/version.py')
+import importlib.util
+spec = importlib.util.spec_from_file_location('resampy.version', '../resampy/version.py')
+resampy_version = importlib.util.module_from_spec(spec)
+spec.loader.exec_module(resampy_version)
# The short X.Y version.
version = resampy_version.short_version
|