From f5c5c1f7d14da884c4d65755c140c6bab2d46727 Mon Sep 17 00:00:00 2001 From: Rob Mohr Date: Fri, 23 Sep 2022 18:51:54 +0000 Subject: [PATCH] pw_system: Remove use of BooleanOptionalAction Remove use of argparse.BooleanOptionalAction which isn't supported by Python 3.8. Change-Id: I1d7ea1dbf6045f620604d6c9e970fd622ed98a69 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/111671 Commit-Queue: Auto-Submit Pigweed-Auto-Submit: Rob Mohr Reviewed-by: Anthony DiGirolamo --- pw_system/py/pw_system/console.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pw_system/py/pw_system/console.py b/pw_system/py/pw_system/console.py index 6a9fbf9661..ad05dd9cf5 100644 --- a/pw_system/py/pw_system/console.py +++ b/pw_system/py/pw_system/console.py @@ -161,11 +161,18 @@ def _parse_args(): dest='use_ipython', help='Use IPython instead of pw_console.') + # TODO(b/248257406) Use argparse.BooleanOptionalAction when Python 3.8 is + # no longer supported. parser.add_argument('--rpc-logging', - action=argparse.BooleanOptionalAction, + action='store_true', default=True, help='Use pw_rpc based logging.') + parser.add_argument('--no-rpc-logging', + action='store_false', + dest='rpc_logging', + help="Don't use pw_rpc based logging.") + return parser.parse_args()