From fca2404b46af7e39dd5106fa412d7936ed5f4bd7 Mon Sep 17 00:00:00 2001 From: "neiljp (Neil Pilgrim)" Date: Wed, 6 Nov 2019 08:06:19 -0800 Subject: [PATCH] mypy: Add type ignore in botserver/server.py. --- zulip_botserver/zulip_botserver/server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zulip_botserver/zulip_botserver/server.py b/zulip_botserver/zulip_botserver/server.py index 00a0110..c6a9a00 100644 --- a/zulip_botserver/zulip_botserver/server.py +++ b/zulip_botserver/zulip_botserver/server.py @@ -70,13 +70,14 @@ def parse_config_file(config_file_path: str) -> configparser.ConfigParser: parser.read(config_file_path) return parser +# TODO: Could we use the function from the bots library for this instead? def load_module_from_file(file_path: str) -> ModuleType: # Wrapper around importutil; see https://stackoverflow.com/a/67692/3909240. spec = importlib.util.spec_from_file_location("custom_bot_module", file_path) lib_module = importlib.util.module_from_spec(spec) assert spec is not None assert spec.loader is not None - spec.loader.exec_module(lib_module) + spec.loader.exec_module(lib_module) # type: ignore # FIXME: typeshed issue? return lib_module def load_lib_modules(available_bots: List[str]) -> Dict[str, Any]: