From fc0a7d09c8991063b4d691933738ad4aa5d32f94 Mon Sep 17 00:00:00 2001 From: AllyW Date: Tue, 13 May 2025 17:53:41 +0800 Subject: [PATCH] validate model module before import --- build_scripts/windows/scripts/patch_models_v2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_scripts/windows/scripts/patch_models_v2.py b/build_scripts/windows/scripts/patch_models_v2.py index 62d4d14aa56..d2b5c1db3ed 100644 --- a/build_scripts/windows/scripts/patch_models_v2.py +++ b/build_scripts/windows/scripts/patch_models_v2.py @@ -245,7 +245,7 @@ def find_models_to_change(module_name): return [ importlib.import_module('.'+label+'.models', main_module.__name__) for (_, label, ispkg) in pkgutil.iter_modules(main_module.__path__) - if ispkg and label != 'aio' and label != '_utils' + if ispkg and label != 'aio' and importlib.util.find_spec('.'+label+'.models', main_module.__name__) ]