add_default_arguments: Correct custom_error_handling type annotation.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
		
							parent
							
								
									524d03fc3e
								
							
						
					
					
						commit
						ddb05ea7eb
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -89,7 +89,7 @@ def add_default_arguments(parser, patch_error_handling=True, allow_provisioning=
 | 
			
		|||
 | 
			
		||||
    if patch_error_handling:
 | 
			
		||||
        def custom_error_handling(self, message):
 | 
			
		||||
            # type: (Any, str) -> None
 | 
			
		||||
            # type: (argparse.ArgumentParser, str) -> None
 | 
			
		||||
            self.print_help(sys.stderr)
 | 
			
		||||
            self.exit(2, '{}: error: {}\n'.format(self.prog, message))
 | 
			
		||||
        parser.error = types.MethodType(custom_error_handling, parser)  # type: ignore # patching function
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue