mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
protect against ImportError
This commit is contained in:
parent
6caeb369d6
commit
274cbb24e4
@ -612,8 +612,11 @@ class Freezer:
|
|||||||
path = self.getModulePath(parentName)
|
path = self.getModulePath(parentName)
|
||||||
if path == None:
|
if path == None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
file, pathname, description = imp.find_module(baseName, path)
|
try:
|
||||||
|
file, pathname, description = imp.find_module(baseName, path)
|
||||||
|
except ImportError:
|
||||||
|
return None
|
||||||
|
|
||||||
if not os.path.isdir(pathname):
|
if not os.path.isdir(pathname):
|
||||||
return None
|
return None
|
||||||
@ -826,7 +829,10 @@ class Freezer:
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
# Otherwise, we can just import it normally.
|
# Otherwise, we can just import it normally.
|
||||||
self.mf.import_hook(mdef.moduleName)
|
try:
|
||||||
|
self.mf.import_hook(mdef.moduleName)
|
||||||
|
except ImportError:
|
||||||
|
print "Unknown module: %s" % (mdef.moduleName)
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
""" After a previous call to done(), this resets the
|
""" After a previous call to done(), this resets the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user