From 954f759955556f8b23d1dd70f5290808c0c78e92 Mon Sep 17 00:00:00 2001 From: FengWen <109639975+ccssu@users.noreply.github.com> Date: Mon, 8 Apr 2024 09:35:23 +0800 Subject: [PATCH] Fix redundant warning printing (#788) --- 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)