fix issue with redirecting the wrong object in the load loop

This commit is contained in:
Thomas S Hatch 2015-08-22 15:05:00 -06:00
parent 7de48e3d31
commit da62361317

View File

@ -1076,13 +1076,14 @@ class LazyLoader(salt.utils.lazy.LazyDict):
if suffix == '.pyx':
mod = self.pyximport.load_module(name, fpath, tempfile.gettempdir())
if suffix == '.o':
top_mod = __import__(fpath, globals(), locals(), [], -1)
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(top_mod, subname)
mod = getattr(mod, subname)
else:
desc = self.suffix_map[suffix]
# if it is a directory, we dont open a file