Skip to content
Browse files

DirectView.sync_imports fixes

ImportErrors are properly raised when no such package exists

describe `local` kwarg's purpose, indicating that `local=False`
is not implemented.

closes #1208
  • Loading branch information...
1 parent 386ea22 commit bf7d20d3bcf75ca348150bfc9f412f0bb3efb773 @minrk minrk committed Dec 26, 2011
Showing with 8 additions and 2 deletions.
  1. +8 −2 IPython/parallel/client/
10 IPython/parallel/client/
@@ -405,7 +405,11 @@ def sync_imports(self, local=True):
"""Context Manager for performing simultaneous local and remote imports.
'import x as y' will *not* work. The 'as y' part will simply be ignored.
+ If `local=True`, then the package will also be imported locally.
+ Note that remote-only (`local=False`) imports have not been implemented.
>>> with view.sync_imports():
... from numpy import recarray
importing recarray from numpy on engine(s)
@@ -468,7 +472,9 @@ def view_import(name, globals={}, locals={}, fromlist=[], level=-1):
# enter the block
except ImportError:
- if not local:
+ if local:
+ raise
+ else:
# ignore import errors if not doing local imports

0 comments on commit bf7d20d

Please sign in to comment.
Something went wrong with that request. Please try again.