mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Throw error when extraArgs is not a list
This commit is contained in:
parent
0f634524be
commit
6786954cf8
@ -119,11 +119,15 @@ class Messenger:
|
||||
"object: %s\n accepting: %s\n method: %s\n extraArgs: %s\n persistent: %s" %
|
||||
(object, event, method, extraArgs, persistent))
|
||||
|
||||
# Make the the method is callable
|
||||
# Make sure that the method is callable
|
||||
assert callable(method), (
|
||||
"method not callable in accept (ignoring): %s %s"%
|
||||
(method, extraArgs))
|
||||
|
||||
# Make sure extraArgs is a list or tuple
|
||||
if not (isinstance(extraArgs, list) or isinstance(extraArgs, tuple) or isinstance(extraArgs, set)):
|
||||
raise TypeError, "A list is required as extraArgs argument"
|
||||
|
||||
self.lock.acquire()
|
||||
try:
|
||||
acceptorDict = self.__callbacks.setdefault(event, {})
|
||||
|
Loading…
x
Reference in New Issue
Block a user