Skip to content

Commit d32d442

Browse files
committed
Upgrade mypy to 0.910.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
1 parent 6263595 commit d32d442

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

requirements.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,8 @@ pytest-cov
1010
-e ./zulip_bots
1111
-e ./zulip_botserver
1212
-e git+https://github.com/zulip/zulint@14e3974001bf8442a6a3486125865660f1f2eb68#egg=zulint==1.0.0
13-
mypy==0.812
13+
mypy==0.910
14+
types-python-dateutil
15+
types-pytz
16+
types-requests
1417
gitlint>=0.13.0

zulip/tests/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import pkgutil
2-
from typing import Iterable
2+
from typing import List
33

4-
__path__ = pkgutil.extend_path(__path__, __name__) # type: Iterable[str]
4+
__path__ = pkgutil.extend_path(__path__, __name__) # type: List[str]

zulip_bots/zulip_bots/bots/witai/witai.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ def get_handle(location: str) -> Optional[Callable[[Dict[str, Any]], Optional[st
8080
"""
8181
try:
8282
spec = importlib.util.spec_from_file_location("module.name", location)
83+
if spec is None:
84+
return None
8385
handler = importlib.util.module_from_spec(spec)
8486
loader = spec.loader
8587
if not isinstance(loader, importlib.abc.Loader):

zulip_bots/zulip_bots/finder.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
def import_module_from_source(path: str, name: str) -> Any:
1515
spec = importlib.util.spec_from_file_location(name, path)
16+
if spec is None:
17+
return None
1618
module = importlib.util.module_from_spec(spec)
1719
loader = spec.loader
1820
if not isinstance(loader, importlib.abc.Loader):

zulip_botserver/tests/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import pkgutil
2-
from typing import Iterable
2+
from typing import List
33

4-
__path__ = pkgutil.extend_path(__path__, __name__) # type: Iterable[str]
4+
__path__ = pkgutil.extend_path(__path__, __name__) # type: List[str]

0 commit comments

Comments
 (0)