mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
replaced try block with hasattr
This commit is contained in:
parent
c20b60222a
commit
31f1f8a99d
@ -22,9 +22,7 @@ class DirectObject:
|
||||
# an unused dictionary taking up space
|
||||
# - the speed hit of calling this function on calls to accept,
|
||||
# ignore, etc. is negligible, since they are not called often
|
||||
try:
|
||||
self.events
|
||||
except:
|
||||
if not hasattr(self, "events"):
|
||||
# list of events that this object is accepting
|
||||
# we use a dictionary to avoid linear searches
|
||||
self.events = {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user