mypy: Fix annotations in core zulip files.

This commit is contained in:
derAnfaenger 2017-09-15 13:24:09 +02:00
parent 59d65309c7
commit 61de5578f2
2 changed files with 4 additions and 3 deletions

View file

@ -106,13 +106,14 @@ def _default_client():
return "ZulipPython/" + __version__
def add_default_arguments(parser, patch_error_handling=True, allow_provisioning=False):
# type: (argparse.ArgumentParser) -> argparse.ArgumentParser
# type: (argparse.ArgumentParser, bool, bool) -> argparse.ArgumentParser
if patch_error_handling:
def custom_error_handling(self, message):
# type: (Any, str) -> None
self.print_help(sys.stderr)
self.exit(2, '{}: error: {}\n'.format(self.prog, message))
parser.error = types.MethodType(custom_error_handling, parser)
parser.error = types.MethodType(custom_error_handling, parser) # type: ignore
if allow_provisioning:
parser.add_argument('--provision',