mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
warning, not error, if a module named in toon.dc doesn't exist.
This commit is contained in:
parent
3d916a1ff3
commit
34d313acb6
@ -21,7 +21,10 @@ class ClientDistClass:
|
|||||||
exec("import " + self.name)
|
exec("import " + self.name)
|
||||||
self.constructor = eval(self.name + "." + self.name)
|
self.constructor = eval(self.name + "." + self.name)
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
self.notify.warning("%s.py does not exist." % (self.name))
|
self.notify.warning("Unable to import %s.py: %s" % (self.name, e))
|
||||||
|
self.constructor = None
|
||||||
|
except (NameError, AttributeError), e:
|
||||||
|
self.notify.warning("%s.%s does not exist: %s" % (self.name, self.name, e))
|
||||||
self.constructor = None
|
self.constructor = None
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ class ClientDistUpdate:
|
|||||||
# Only catch name and attribute errors
|
# Only catch name and attribute errors
|
||||||
# as all other errors are legit errors
|
# as all other errors are legit errors
|
||||||
except ImportError, e:
|
except ImportError, e:
|
||||||
self.notify.warning("%s.py does not exist." % (cdc.name))
|
self.notify.warning("Unable to import %s.py: %s" % (cdc.name, e))
|
||||||
self.func = None
|
self.func = None
|
||||||
except (NameError, AttributeError), e:
|
except (NameError, AttributeError), e:
|
||||||
#self.notify.warning(cdc.name + "." + self.name +
|
#self.notify.warning(cdc.name + "." + self.name +
|
||||||
|
@ -431,6 +431,8 @@ class ClientRepository(DirectObject.DirectObject):
|
|||||||
# If it is not in the dictionary or the cache, then...
|
# If it is not in the dictionary or the cache, then...
|
||||||
else:
|
else:
|
||||||
# Construct a new one
|
# Construct a new one
|
||||||
|
if cdc.constructor == None:
|
||||||
|
self.notify.error("Could not create an undefined %s object." % (cdc.name))
|
||||||
distObj = cdc.constructor(self)
|
distObj = cdc.constructor(self)
|
||||||
# Assign it an Id
|
# Assign it an Id
|
||||||
distObj.doId = doId
|
distObj.doId = doId
|
||||||
|
Loading…
x
Reference in New Issue
Block a user