fix crash when ReplApplication.do() is called with a function instead of a backend method name
This commit is contained in:
parent
55de13b53b
commit
8d48d0d706
1 changed files with 3 additions and 2 deletions
|
|
@ -342,8 +342,9 @@ class ReplApplication(Cmd, ConsoleApplication):
|
|||
if backends is None:
|
||||
kwargs['backends'] = []
|
||||
for backend in self.enabled_backends:
|
||||
actual_function = getattr(backend, function, None)
|
||||
if actual_function is not None and callable(actual_function):
|
||||
actual_function = getattr(backend, function, None) if isinstance(function, basestring) else function
|
||||
|
||||
if callable(actual_function):
|
||||
kwargs['backends'].append(backend)
|
||||
else:
|
||||
kwargs['backends'] = backends
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue