forked from pool/python-pathtools
- 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:
24
stop-using-imp.patch
Normal file
24
stop-using-imp.patch
Normal 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):
|
||||
"""
|
||||
Reference in New Issue
Block a user