Change callability check

TypeErrors are thrown in a wide variety of situations, most of which
have nothing to do with calling an uncallable object. The appropriate
test is to use the built-in callable() function, which actually
tests if the object is callable.
This commit is contained in:
Aris (Karim) Merchant 2018-07-30 16:37:22 -07:00
parent 27875ba04d
commit 1feceea4e8

View file

@ -296,9 +296,9 @@ class CmdSet(with_metaclass(_CmdSetMeta, object)):
result (any): An instantiated Command or the input unmodified.
"""
try:
if callable(cmd):
return cmd()
except TypeError:
else:
return cmd
def _duplicate(self):