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:
|
if backends is None:
|
||||||
kwargs['backends'] = []
|
kwargs['backends'] = []
|
||||||
for backend in self.enabled_backends:
|
for backend in self.enabled_backends:
|
||||||
actual_function = getattr(backend, function, None)
|
actual_function = getattr(backend, function, None) if isinstance(function, basestring) else function
|
||||||
if actual_function is not None and callable(actual_function):
|
|
||||||
|
if callable(actual_function):
|
||||||
kwargs['backends'].append(backend)
|
kwargs['backends'].append(backend)
|
||||||
else:
|
else:
|
||||||
kwargs['backends'] = backends
|
kwargs['backends'] = backends
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue