Properly catch ImportError

This commit is contained in:
rdb 2011-10-31 15:20:04 +00:00
parent 4896c93827
commit 8ca42e3964

View File

@ -675,7 +675,10 @@ class Freezer:
if path == 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):
return None