From 15038d76132597b716bd37cf30ee7e2f991ff5ca Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Wed, 28 Sep 2022 16:00:55 -0700 Subject: [PATCH 1/2] Respect per-module follow_import for empty folders Fixes #13757 --- mypy/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/build.py b/mypy/build.py index fd9feb348d44..caa1b3ab5e69 100644 --- a/mypy/build.py +++ b/mypy/build.py @@ -2592,7 +2592,7 @@ def find_module_and_diagnose( if ( root_source # Honor top-level modules or ( - not result.endswith(".py") # Stubs are always normal + result.endswith(".pyi") # Stubs are always normal and not options.follow_imports_for_stubs ) # except when they aren't or id in mypy.semanal_main.core_modules From 18f77f35beba08d44fda36c024c6e027f33fee46 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Wed, 28 Sep 2022 16:11:07 -0700 Subject: [PATCH 2/2] move comments into place --- mypy/build.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mypy/build.py b/mypy/build.py index caa1b3ab5e69..6f5a397019b6 100644 --- a/mypy/build.py +++ b/mypy/build.py @@ -2593,10 +2593,10 @@ def find_module_and_diagnose( root_source # Honor top-level modules or ( result.endswith(".pyi") # Stubs are always normal - and not options.follow_imports_for_stubs - ) # except when they aren't - or id in mypy.semanal_main.core_modules - ): # core is always normal + and not options.follow_imports_for_stubs # except when they aren't + ) + or id in mypy.semanal_main.core_modules # core is always normal + ): follow_imports = "normal" if skip_diagnose: pass