mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
add zipimport functionality for module loading
This commit is contained in:
parent
763ee20713
commit
92a9bd47a1
@ -1074,7 +1074,16 @@ class LazyLoader(salt.utils.lazy.LazyDict):
|
||||
sys.path.append(os.path.dirname(fpath))
|
||||
if suffix == '.pyx':
|
||||
mod = self.pyximport.load_module(name, fpath, tempfile.gettempdir())
|
||||
if suffix == '.zip':
|
||||
elif suffix == '.o':
|
||||
top_mod = __import__(fpath, globals(), locals(), [])
|
||||
comps = fpath.split('.')
|
||||
if len(comps) < 2:
|
||||
mod = top_mod
|
||||
else:
|
||||
mod = top_mod
|
||||
for subname in comps[1:]:
|
||||
mod = getattr(mod, subname)
|
||||
elif suffix == '.zip':
|
||||
mod = zipimporter(fpath).load_module(name)
|
||||
else:
|
||||
desc = self.suffix_map[suffix]
|
||||
|
Loading…
Reference in New Issue
Block a user