diff options
author | wbond <will@wbond.net> | 2019-12-29 01:46:19 -0500 |
---|---|---|
committer | wbond <will@wbond.net> | 2019-12-29 01:46:19 -0500 |
commit | 213e4fb24f5f1a7f78c9f08862b0b8728fec1510 (patch) | |
tree | c2a2e40309bb86e36ec1cd283c5aaa3149e28afd /dev | |
parent | 6de6919e724f3e3d7b0022fb4a2b939ab5699f13 (diff) | |
download | asn1crypto-213e4fb24f5f1a7f78c9f08862b0b8728fec1510.tar.gz |
Fix _import_from() on Python 2
Diffstat (limited to 'dev')
-rw-r--r-- | dev/_import.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/dev/_import.py b/dev/_import.py index 680e7d1..caad219 100644 --- a/dev/_import.py +++ b/dev/_import.py @@ -44,6 +44,10 @@ def _import_from(mod, path, mod_dir=None, allow_error=False): and not os.path.exists(os.path.join(path, mod_dir + '.py')): return None + if os.sep in mod_dir: + append, mod_dir = mod_dir.rsplit(os.sep, 1) + path = os.path.join(path, append) + try: mod_info = imp.find_module(mod_dir, [path]) return imp.load_module(mod, *mod_info) |