]> scripts.mit.edu Git - wizard.git/commitdiff
Make the import failure handling code fail out if a sub-import failed.
authorAndrew Farrell <afarrell@mit.edu>
Mon, 7 Dec 2009 04:34:32 +0000 (23:34 -0500)
committerEdward Z. Yang <ezyang@mit.edu>
Mon, 7 Dec 2009 08:03:32 +0000 (03:03 -0500)
Signed-off-by: Andrew Farrell <afarrell@mit.edu>
wizard/app/__init__.py

index 28c7d8fd0d1d84c4794c97a973d420a34e1b87c9..a289cef4d237b82719a02cb6c002e44d33fefee6 100644 (file)
@@ -346,8 +346,13 @@ class Application(object):
         try:
             __import__("wizard.app." + name)
             return getattr(wizard.app, name).Application(name)
-        except ImportError:
-            return Application(name)
+        except ImportError as error:
+            # XXX ugly hack to check if the import error is from the top level
+            # module we care about or a submodule. should be an archetectural change.
+            if error.args[0].split()[-1]==name:
+                return Application(name)
+            else:
+                raise
 
 class ApplicationVersion(object):
     """Represents an abstract notion of a version for an application, where