diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-03-26 20:31:07 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2018-03-26 20:31:07 -0400 |
commit | 2b4f94f09bfeddd4a9a5f241eced3aff976371e5 (patch) | |
tree | 52ccc9c76490cf140d7948379422e0db83afd0b5 /cmd2.py | |
parent | 5116720d50d95094aa02210ea9875858c995d4c6 (diff) | |
download | cmd2-git-2b4f94f09bfeddd4a9a5f241eced3aff976371e5.tar.gz |
Simplified code
Diffstat (limited to 'cmd2.py')
-rwxr-xr-x | cmd2.py | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -3106,13 +3106,12 @@ Usage: Usage: unalias [-a] name [name ...] begidx -= diff endidx -= diff - # Call the subcommand specific completer + # Call the subcommand specific completer if it exists completer = 'complete_{}_{}'.format(base, subcommand) - try: - compfunc = getattr(self, completer) + compfunc = getattr(self, completer, None) + + if compfunc is not None: matches = compfunc(text, line, begidx, endidx) - except AttributeError: - pass return matches |