15
0

- Add patch stop-using-imp.patch:

* Stop using imp module, switch to importlib.*
- Use pyproject macros.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pathtools?expand=0&rev=15
This commit is contained in:
2023-08-16 05:18:32 +00:00
committed by Git OBS Bridge
parent 67be70a7e6
commit 02d6798d24
3 changed files with 40 additions and 5 deletions

24
stop-using-imp.patch Normal file
View File

@@ -0,0 +1,24 @@
Index: pathtools-0.1.2/setup.py
===================================================================
--- pathtools-0.1.2.orig/setup.py
+++ pathtools-0.1.2/setup.py
@@ -22,12 +22,16 @@
# THE SOFTWARE.
import os
-import imp
+import importlib.machinery
+import importlib.util
from setuptools import setup
PKG_DIR = 'pathtools'
-version = imp.load_source('version',
- os.path.join(PKG_DIR, 'version.py'))
+path = os.path.join(PKG_DIR, 'version.py')
+loader = importlib.machinery.SourceFileLoader("pathtools", path)
+spec = importlib.util.spec_from_file_location("pathtools", path)
+version = importlib.util.module_from_spec(spec)
+loader.exec_module(version)
def read_file(filename):
"""