From cc959d976338fa34b07aa8774fdf28d7f114098b Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sun, 11 Dec 2022 15:30:18 -0800 Subject: [PATCH] fix tests --- mypy/stubtest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mypy/stubtest.py b/mypy/stubtest.py index acecc871c4806..5c2f3c0d7e15e 100644 --- a/mypy/stubtest.py +++ b/mypy/stubtest.py @@ -1497,6 +1497,8 @@ def build_stubs(modules: list[str], options: Options, find_submodules: bool = Fa # find submodules via pkgutil try: runtime = silent_import_module(module) + runtime_path = runtime.__path__ + runtime_name = runtime.__name__ except KeyboardInterrupt: raise except BaseException: @@ -1504,7 +1506,7 @@ def build_stubs(modules: list[str], options: Options, find_submodules: bool = Fa else: all_modules.extend( m.name - for m in pkgutil.walk_packages(runtime.__path__, runtime.__name__ + ".") + for m in pkgutil.walk_packages(runtime_path, runtime_name + ".") if m.name not in all_modules )