mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -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
|
# an unused dictionary taking up space
|
||||||
# - the speed hit of calling this function on calls to accept,
|
# - the speed hit of calling this function on calls to accept,
|
||||||
# ignore, etc. is negligible, since they are not called often
|
# ignore, etc. is negligible, since they are not called often
|
||||||
try:
|
if not hasattr(self, "events"):
|
||||||
self.events
|
|
||||||
except:
|
|
||||||
# list of events that this object is accepting
|
# list of events that this object is accepting
|
||||||
# we use a dictionary to avoid linear searches
|
# we use a dictionary to avoid linear searches
|
||||||
self.events = {}
|
self.events = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user