Skip to content

Commit b4e2d34

Browse files
nparleyjreback
authored andcommitted
TST: Remove imp and just use importlib to avoid memory error when showing versions
closes #13282 Author: Neil Parley <[email protected]> Closes #13284 from nparley/imp and squashes the following commits: 29b98f7 [Neil Parley] Move import to top ca5fa7a [Neil Parley] Remove imp and just use importlib to avoid memory error when importing blosc.
1 parent da5fc17 commit b4e2d34

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

pandas/util/print_versions.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import struct
55
import subprocess
66
import codecs
7+
import importlib
78

89

910
def get_sys_info():
@@ -55,7 +56,6 @@ def get_sys_info():
5556

5657

5758
def show_versions(as_json=False):
58-
import imp
5959
sys_info = get_sys_info()
6060

6161
deps = [
@@ -99,11 +99,7 @@ def show_versions(as_json=False):
9999
deps_blob = list()
100100
for (modname, ver_f) in deps:
101101
try:
102-
try:
103-
mod = imp.load_module(modname, *imp.find_module(modname))
104-
except (ImportError):
105-
import importlib
106-
mod = importlib.import_module(modname)
102+
mod = importlib.import_module(modname)
107103
ver = ver_f(mod)
108104
deps_blob.append((modname, ver))
109105
except:

0 commit comments

Comments
 (0)