From 50887abf8fb19e89de1564d64ec202b001c25207 Mon Sep 17 00:00:00 2001 From: ccsuu Date: Sun, 7 Apr 2024 08:47:54 +0000 Subject: [PATCH] Fix redundant warning printing --- src/onediff/infer_compiler/import_tools/dyn_mock_mod.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/onediff/infer_compiler/import_tools/dyn_mock_mod.py b/src/onediff/infer_compiler/import_tools/dyn_mock_mod.py index 11c2d000b..1a0ed4716 100644 --- a/src/onediff/infer_compiler/import_tools/dyn_mock_mod.py +++ b/src/onediff/infer_compiler/import_tools/dyn_mock_mod.py @@ -71,7 +71,7 @@ def proxy_func(*args, **kwargs): raise RuntimeError( f"Not support {module_name} with parameters Module: {module}" ) - sub_module = getattr(sub_module, attr) + sub_module = getattr(sub_module, attr, None) return sub_module @@ -108,9 +108,6 @@ def _update_module(full_names, main_pkg_enable_context): value = getattr_from_module_name(other, module_name=str(sample_module)) if value is None: - logger.warning( - f"Skip {str(sample_module)} because is not supported" - ) continue setattr(module, attr_name, value)