From 9b5a98825a9b00807a40494e8c634c392077ccd2 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Tue, 25 Aug 2020 01:46:04 -0400 Subject: Fixed RecursionError when printing an argparse.Namespace caused by custom attribute cmd2 was adding Added get_statement() function to argparse.Namespace which returns __statement__ attribute --- examples/decorator_example.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/decorator_example.py b/examples/decorator_example.py index 0f5374ce..5b721da6 100755 --- a/examples/decorator_example.py +++ b/examples/decorator_example.py @@ -67,7 +67,7 @@ class CmdLineApp(cmd2.Cmd): def do_tag(self, args: argparse.Namespace): """create an html tag""" # The Namespace always includes the Statement object created when parsing the command line - statement = args.__statement__ + statement = args.get_statement() self.poutput("The command line you ran was: {}".format(statement.command_and_args)) self.poutput("It generated this tag:") -- cgit v1.2.1