From 5546bd8d72d67c6a605f19e427deb137443097af Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Thu, 11 Jul 2019 23:20:53 -0400 Subject: Changed how re is being imported --- cmd2/argparse_custom.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cmd2/argparse_custom.py') diff --git a/cmd2/argparse_custom.py b/cmd2/argparse_custom.py index dbe12d93..43099823 100644 --- a/cmd2/argparse_custom.py +++ b/cmd2/argparse_custom.py @@ -140,7 +140,7 @@ argparse.ArgumentParser._match_argument - adds support to for nargs ranges """ import argparse -import re as _re +import re import sys # noinspection PyUnresolvedReferences,PyProtectedMember @@ -369,7 +369,7 @@ orig_argument_parser_match_argument = argparse.ArgumentParser._match_argument def _match_argument_wrapper(self, action, arg_strings_pattern) -> int: # Wrapper around ArgumentParser._match_argument behavior to support nargs ranges nargs_pattern = self._get_nargs_pattern(action) - match = _re.match(nargs_pattern, arg_strings_pattern) + match = re.match(nargs_pattern, arg_strings_pattern) # raise an exception if we weren't able to find a match if match is None: @@ -444,9 +444,9 @@ class Cmd2HelpFormatter(argparse.RawTextHelpFormatter): req_usage = format(required_options, groups) opt_usage = format(optionals, groups) pos_usage = format(positionals, groups) - req_parts = _re.findall(part_regexp, req_usage) - opt_parts = _re.findall(part_regexp, opt_usage) - pos_parts = _re.findall(part_regexp, pos_usage) + req_parts = re.findall(part_regexp, req_usage) + opt_parts = re.findall(part_regexp, opt_usage) + pos_parts = re.findall(part_regexp, pos_usage) assert ' '.join(req_parts) == req_usage assert ' '.join(opt_parts) == opt_usage assert ' '.join(pos_parts) == pos_usage -- cgit v1.2.1