@@ -700,10 +700,7 @@ def _build_parser(
700700 elif callable (parser_builder ):
701701 parser = parser_builder ()
702702 elif isinstance (parser_builder , argparse .ArgumentParser ):
703- if sys .version_info >= (3 , 6 , 4 ):
704- parser = copy .deepcopy (parser_builder )
705- else : # pragma: no cover
706- parser = parser_builder
703+ parser = copy .deepcopy (parser_builder )
707704 return parser
708705
709706 def _register_command_parser (self , command : str , command_method : Callable [..., Any ]) -> None :
@@ -780,7 +777,7 @@ def unregister_command_set(self, cmdset: CommandSet) -> None:
780777
781778 methods : List [Tuple [str , Callable [[Any ], Any ]]] = inspect .getmembers (
782779 cmdset ,
783- predicate = lambda meth : isinstance (meth , Callable ) # type: ignore[arg-type, var-annotated ]
780+ predicate = lambda meth : isinstance (meth , Callable ) # type: ignore[arg-type]
784781 and hasattr (meth , '__name__' )
785782 and meth .__name__ .startswith (COMMAND_FUNC_PREFIX ),
786783 )
@@ -811,7 +808,7 @@ def unregister_command_set(self, cmdset: CommandSet) -> None:
811808 def _check_uninstallable (self , cmdset : CommandSet ) -> None :
812809 methods : List [Tuple [str , Callable [[Any ], Any ]]] = inspect .getmembers (
813810 cmdset ,
814- predicate = lambda meth : isinstance (meth , Callable ) # type: ignore[arg-type, var-annotated ]
811+ predicate = lambda meth : isinstance (meth , Callable ) # type: ignore[arg-type]
815812 and hasattr (meth , '__name__' )
816813 and meth .__name__ .startswith (COMMAND_FUNC_PREFIX ),
817814 )
@@ -3328,19 +3325,14 @@ def _cmdloop(self) -> None:
33283325 #############################################################
33293326
33303327 # Top-level parser for alias
3331- @staticmethod
3332- def _build_alias_parser () -> argparse .ArgumentParser :
3333- alias_description = (
3334- "Manage aliases\n " "\n " "An alias is a command that enables replacement of a word by another string."
3335- )
3336- alias_epilog = "See also:\n " " macro"
3337- alias_parser = argparse_custom .DEFAULT_ARGUMENT_PARSER (description = alias_description , epilog = alias_epilog )
3338- alias_subparsers = alias_parser .add_subparsers (dest = 'subcommand' , metavar = 'SUBCOMMAND' )
3339- alias_subparsers .required = True
3340- return alias_parser
3328+ alias_description = "Manage aliases\n " "\n " "An alias is a command that enables replacement of a word by another string."
3329+ alias_epilog = "See also:\n " " macro"
3330+ alias_parser = argparse_custom .DEFAULT_ARGUMENT_PARSER (description = alias_description , epilog = alias_epilog )
3331+ alias_subparsers = alias_parser .add_subparsers (dest = 'subcommand' , metavar = 'SUBCOMMAND' )
3332+ alias_subparsers .required = True
33413333
33423334 # Preserve quotes since we are passing strings to other commands
3343- @with_argparser (_build_alias_parser , preserve_quotes = True )
3335+ @with_argparser (alias_parser , preserve_quotes = True )
33443336 def do_alias (self , args : argparse .Namespace ) -> None :
33453337 """Manage aliases"""
33463338 # Call handler for whatever subcommand was selected
0 commit comments