Skip to content

Commit 25d6c68

Browse files
committed
mypy: zulip_botserver: Fix errors in setup.py.
1 parent ed51cab commit 25d6c68

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

tools/run-mypy

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ sys.path.append(os.path.dirname(TOOLS_DIR))
2121
exclude = """
2222
zulip/integrations/perforce/git_p4.py
2323
zulip_bots/zulip_bots/bots
24-
zulip_botserver/setup.py
2524
""".split()
2625

2726
parser = argparse.ArgumentParser(description="Run mypy on files tracked by git.")

zulip_botserver/setup.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
import os
77
import sys
8+
if False:
9+
from typing import Any, Dict, Optional
810

911
ZULIP_BOTSERVER_VERSION = "0.3.7"
1012

@@ -51,14 +53,15 @@
5153

5254
# Manual dependency check
5355
def check_dependency_manually(module_name, version=None):
56+
# type: (str, Optional[str]) -> None
5457
try:
55-
module = import_module(module_name)
58+
module = import_module(module_name) # type: Any
5659
if version is not None:
5760
assert(LooseVersion(module.__version__) >= LooseVersion(version))
5861
except (ImportError, AssertionError):
5962
if version is not None:
6063
print("{name}>={version} is not installed.".format(
61-
req=req, version=version), file=sys.stderr)
64+
name=module_name, version=version), file=sys.stderr)
6265
else:
6366
print("{name} is not installed.".format(name=module_name), file=sys.stderr)
6467
sys.exit(1)

0 commit comments

Comments
 (0)