Browse Source

squelch errors correctly

David Rose 16 years ago
parent
commit
78039485d6
1 changed files with 5 additions and 5 deletions
  1. 5 5
      direct/src/showutil/FreezeTool.py

+ 5 - 5
direct/src/showutil/FreezeTool.py

@@ -752,7 +752,10 @@ class Freezer:
 
         # Attempt to import the explicit modules into the modulefinder.
         for mdef in includes:
-            self.__loadModule(mdef)
+            try:
+                self.__loadModule(mdef)
+            except ImportError:
+                print "Unknown module: %s" % (mdef.moduleName)
 
         # Also attempt to import any implicit modules.  If any of
         # these fail to import, we don't really care.
@@ -829,10 +832,7 @@ class Freezer:
 
         else:
             # Otherwise, we can just import it normally.
-            try:
-                self.mf.import_hook(mdef.moduleName)
-            except ImportError:
-                print "Unknown module: %s" % (mdef.moduleName)
+            self.mf.import_hook(mdef.moduleName)
 
     def reset(self):
         """ After a previous call to done(), this resets the