Skip to content

Commit 96145c7

Browse files
committed
Check if the callback can be called.
1 parent 9a6330f commit 96145c7

File tree

1 file changed

+4
-0
lines changed
  • addons/source-python/packages/source-python/cvars

1 file changed

+4
-0
lines changed

addons/source-python/packages/source-python/cvars/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ def __init__(self, *convars):
6464

6565
def __call__(self, callback):
6666
"""Store the callback and add it to convars."""
67+
# Is the callback callable?
68+
if not callable(callback):
69+
raise ValueError('Given callback is not callable.')
70+
6771
# Store the callback
6872
self.callback = callback
6973

0 commit comments

Comments
 (0)