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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
--- a/PyWCSTools/wcscon.py 2018-08-22 16:17:28.000000000 +0800
+++ b/PyWCSTools/wcscon.py 2024-05-23 16:18:18.742652781 +0800
@@ -10,19 +10,10 @@
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
- import imp
- fp = None
- try:
- fp, pathname, description = imp.find_module('_wcscon', [dirname(__file__)])
- except ImportError:
- import _wcscon
- return _wcscon
- if fp is not None:
- try:
- _mod = imp.load_module('_wcscon', fp, pathname, description)
- finally:
- fp.close()
- return _mod
+ import importlib, sys
+ sys.path.append(dirname(__file__))
+ _mod = importlib.import_module('_wcscon')
+ return _mod
_wcscon = swig_import_helper()
del swig_import_helper
else:
--- a/PyWCSTools/wcs.py 2018-08-22 16:17:28.000000000 +0800
+++ b/PyWCSTools/wcs.py 2024-05-23 16:18:10.225938680 +0800
@@ -10,19 +10,10 @@
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
- import imp
- fp = None
- try:
- fp, pathname, description = imp.find_module('_wcs', [dirname(__file__)])
- except ImportError:
- import _wcs
- return _wcs
- if fp is not None:
- try:
- _mod = imp.load_module('_wcs', fp, pathname, description)
- finally:
- fp.close()
- return _mod
+ import importlib, sys
+ sys.path.append(dirname(__file__))
+ _mod = importlib.import_module('_wcs')
+ return _mod
_wcs = swig_import_helper()
del swig_import_helper
else:
|