summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzack chen <zackchen517@gmail.com>2022-06-29 14:38:18 +0800
committerzack chen <zackchen517@gmail.com>2022-06-29 14:38:18 +0800
commit1f3b6634857e346e2be225a5552469213f329194 (patch)
tree671a0bdcc65ade1fce5a7d52e6f1f64ff5513fb1
parent2c7d463f376c4cb6259291a925ad6cfc48c00f09 (diff)
downloadpython-cinderclient-1f3b6634857e346e2be225a5552469213f329194.tar.gz
Fix extension loading from python path
Commit 3502a5591a654ae57741c6738994ffa9d8457696 broke extension loading from pythonpath. Incompatible on python3.6.8, python3.8, python3.9. Put it back. Closes-Bug: #1980184 Change-Id: I5b67c93e3c789252d9bd35ee69dddbe1b556dec4
-rw-r--r--cinderclient/client.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/cinderclient/client.py b/cinderclient/client.py
index 6beb381..2c1006f 100644
--- a/cinderclient/client.py
+++ b/cinderclient/client.py
@@ -797,6 +797,8 @@ def discover_extensions(version):
def _discover_via_python_path():
for (module_loader, name, ispkg) in pkgutil.iter_modules():
if name.endswith('cinderclient_ext'):
+ if not hasattr(module_loader, 'load_module'):
+ module_loader = module_loader.find_module(name)
module = module_loader.load_module(name)
yield name, module