mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
LazyLoader deepcopy fix.
Don't keep module object as a field of LazyLoader that breaks deepcopying.
This commit is contained in:
parent
340229355c
commit
8c256c94f4
1 changed files with 5 additions and 3 deletions
|
@ -957,8 +957,9 @@ class LazyLoader(salt.utils.lazy.LazyDict):
|
|||
|
||||
if self.opts.get('cython_enable', True) is True:
|
||||
try:
|
||||
self.pyximport = __import__('pyximport') # pylint: disable=import-error
|
||||
self.pyximport.install()
|
||||
global pyximport
|
||||
pyximport = __import__('pyximport') # pylint: disable=import-error
|
||||
pyximport.install()
|
||||
# add to suffix_map so file_mapping will pick it up
|
||||
self.suffix_map['.pyx'] = tuple()
|
||||
except ImportError:
|
||||
|
@ -1093,7 +1094,8 @@ class LazyLoader(salt.utils.lazy.LazyDict):
|
|||
try:
|
||||
sys.path.append(os.path.dirname(fpath))
|
||||
if suffix == '.pyx':
|
||||
mod = self.pyximport.load_module(name, fpath, tempfile.gettempdir())
|
||||
global pyximport
|
||||
mod = pyximport.load_module(name, fpath, tempfile.gettempdir())
|
||||
elif suffix == '.o':
|
||||
top_mod = __import__(fpath, globals(), locals(), [])
|
||||
comps = fpath.split('.')
|
||||
|
|
Loading…
Add table
Reference in a new issue