From 46ee6cb81720d231c98dec34ad752ed671d628b5 2012-09-07 23:51:19 From: MinRK Date: 2012-09-07 23:51:19 Subject: [PATCH] Don't catch ImportError when trying to unpack module functions If the ImportError is encountered, it is more informative to raise it rather than hide it, possibly resulting in confusing NameErrors due to the import failure. --- diff --git a/IPython/utils/pickleutil.py b/IPython/utils/pickleutil.py index 6cc0dc3..3b4735a 100644 --- a/IPython/utils/pickleutil.py +++ b/IPython/utils/pickleutil.py @@ -98,12 +98,8 @@ class CannedFunction(CannedObject): def get_object(self, g=None): # try to load function back into its module: if not self.module.startswith('__'): - try: - __import__(self.module) - except ImportError: - pass - else: - g = sys.modules[self.module].__dict__ + __import__(self.module) + g = sys.modules[self.module].__dict__ if g is None: g = {}