Upgrade mypy to 0.910.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-08-24 19:50:14 -07:00
parent 626359596e
commit d32d442c44
5 changed files with 12 additions and 5 deletions

View file

@ -10,5 +10,8 @@ pytest-cov
-e ./zulip_bots -e ./zulip_bots
-e ./zulip_botserver -e ./zulip_botserver
-e git+https://github.com/zulip/zulint@14e3974001bf8442a6a3486125865660f1f2eb68#egg=zulint==1.0.0 -e git+https://github.com/zulip/zulint@14e3974001bf8442a6a3486125865660f1f2eb68#egg=zulint==1.0.0
mypy==0.812 mypy==0.910
types-python-dateutil
types-pytz
types-requests
gitlint>=0.13.0 gitlint>=0.13.0

View file

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

View file

@ -80,6 +80,8 @@ def get_handle(location: str) -> Optional[Callable[[Dict[str, Any]], Optional[st
""" """
try: try:
spec = importlib.util.spec_from_file_location("module.name", location) spec = importlib.util.spec_from_file_location("module.name", location)
if spec is None:
return None
handler = importlib.util.module_from_spec(spec) handler = importlib.util.module_from_spec(spec)
loader = spec.loader loader = spec.loader
if not isinstance(loader, importlib.abc.Loader): if not isinstance(loader, importlib.abc.Loader):

View file

@ -13,6 +13,8 @@ import importlib_metadata as metadata
def import_module_from_source(path: str, name: str) -> Any: def import_module_from_source(path: str, name: str) -> Any:
spec = importlib.util.spec_from_file_location(name, path) spec = importlib.util.spec_from_file_location(name, path)
if spec is None:
return None
module = importlib.util.module_from_spec(spec) module = importlib.util.module_from_spec(spec)
loader = spec.loader loader = spec.loader
if not isinstance(loader, importlib.abc.Loader): if not isinstance(loader, importlib.abc.Loader):

View file

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