summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-09-17 12:50:48 -0400
committerGitHub <noreply@github.com>2018-09-17 12:50:48 -0400
commit36d9ec82c50b037becc204f9fc05d94c4d391ccf (patch)
tree37fb7db479400bb7f70e079a4649986bd4794044 /cmd2/cmd2.py
parent49236d98a770d9604e65eb1728d2f8d68e35d493 (diff)
parentc5cd46c029c5ee48a2b319ef04d713be44b97383 (diff)
downloadcmd2-git-36d9ec82c50b037becc204f9fc05d94c4d391ccf.tar.gz
Merge pull request #521 from python-cmd2/callable
Corrected callable check
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r--cmd2/cmd2.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index fb929078..888d9531 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -1557,7 +1557,7 @@ class Cmd(cmd.Cmd):
def get_all_commands(self) -> List[str]:
"""Returns a list of all commands."""
return [name[3:] for name in self.get_names()
- if name.startswith('do_') and isinstance(getattr(self, name), Callable)]
+ if name.startswith('do_') and callable(getattr(self, name))]
def get_visible_commands(self) -> List[str]:
"""Returns a list of commands that have not been hidden."""
@@ -1573,7 +1573,7 @@ class Cmd(cmd.Cmd):
def get_help_topics(self) -> List[str]:
""" Returns a list of help topics """
return [name[5:] for name in self.get_names()
- if name.startswith('help_') and isinstance(getattr(self, name), Callable)]
+ if name.startswith('help_') and callable(getattr(self, name))]
def complete_help(self, text: str, line: str, begidx: int, endidx: int) -> List[str]:
"""
@@ -2882,13 +2882,13 @@ Paths or arguments that contain spaces must be enclosed in quotes
if self.locals_in_py:
def load_ipy(self, app):
- banner = 'Entering an embedded IPython shell type quit() or <Ctrl>-d to exit ...'
+ banner = 'Entering an embedded IPython shell. Type quit() or <Ctrl>-d to exit ...'
exit_msg = 'Leaving IPython, back to {}'.format(sys.argv[0])
embed(banner1=banner, exit_msg=exit_msg)
load_ipy(self, bridge)
else:
def load_ipy(app):
- banner = 'Entering an embedded IPython shell type quit() or <Ctrl>-d to exit ...'
+ banner = 'Entering an embedded IPython shell. Type quit() or <Ctrl>-d to exit ...'
exit_msg = 'Leaving IPython, back to {}'.format(sys.argv[0])
embed(banner1=banner, exit_msg=exit_msg)
load_ipy(bridge)