Skip to content

Commit

Permalink
Fix pickle issue (DM-17720)
Browse files Browse the repository at this point in the history
DM-17148 changed the way the modules were imported and that broke
pickle. Need to revert to `importlib.import_module` to fix pickle
issues.
  • Loading branch information
andy-slac committed Feb 5, 2019
1 parent 4586489 commit 21b9299
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/lsst/ctrl/mpexec/taskLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,9 @@ def loadTaskClass(self, task_class_name):
_LOG.debug("load_task_class: module %r does not exist", full_module_name)
continue
else:
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
# NOTE: importlib.util.module_from_spec has some issues with pickle,
# do not use it.
module = importlib.import_module(full_module_name)
_LOG.debug("load_task_class: imported %r", full_module_name)
except Exception as exc:
raise ImportError(f"Import of module {module_name} failed") from exc
Expand Down

0 comments on commit 21b9299

Please sign in to comment.