mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -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,8 +21,11 @@ class ClientDistClass:
|
||||
exec("import " + self.name)
|
||||
self.constructor = eval(self.name + "." + self.name)
|
||||
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
|
||||
return None
|
||||
|
||||
def parseFields(self, dcClass):
|
||||
|
@ -28,7 +28,7 @@ class ClientDistUpdate:
|
||||
# Only catch name and attribute errors
|
||||
# as all other errors are legit errors
|
||||
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
|
||||
except (NameError, AttributeError), e:
|
||||
#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...
|
||||
else:
|
||||
# Construct a new one
|
||||
if cdc.constructor == None:
|
||||
self.notify.error("Could not create an undefined %s object." % (cdc.name))
|
||||
distObj = cdc.constructor(self)
|
||||
# Assign it an Id
|
||||
distObj.doId = doId
|
||||
|
Loading…
x
Reference in New Issue
Block a user