diff options
author | Corey Bryant <corey.bryant@canonical.com> | 2018-02-28 10:49:24 -0500 |
---|---|---|
committer | Corey Bryant <corey.bryant@canonical.com> | 2018-03-06 10:33:35 -0500 |
commit | 8416650128b9a1ae8c7fd1bfe2a8d1a49a9b6a0b (patch) | |
tree | b99d301e9118b22354303fdbb614166733a5a654 | |
parent | be3c326f55277ef3c52262b53c112ba7c3f5a933 (diff) | |
download | cliff-8416650128b9a1ae8c7fd1bfe2a8d1a49a9b6a0b.tar.gz |
Align parsed() call with cmd2 versions >= 0.7.3
In version 0.7.3, cmd2 moved the parsed method from class Cmd()
to class ParserManager().
Change-Id: Ie0c057ffaeaa05c4f5e0f3599aab850245c55066
Closes-Bug: #1751822
-rw-r--r-- | cliff/interactive.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cliff/interactive.py b/cliff/interactive.py index 74b5f54..68f7959 100644 --- a/cliff/interactive.py +++ b/cliff/interactive.py @@ -111,7 +111,13 @@ class InteractiveApp(cmd2.Cmd): # Dispatch to the underlying help command, # which knows how to provide help for extension # commands. - self.default(self.parsed('help ' + arg)) + try: + # NOTE(coreycb): This try path can be removed once + # requirements.txt has cmd2 >= 0.7.3. + parsed = self.parsed + except AttributeError: + parsed = self.parser_manager.parsed + self.default(parsed('help ' + arg)) else: cmd2.Cmd.do_help(self, arg) cmd_names = sorted([n for n, v in self.command_manager]) |