From 3d808c15847b54cff0f0aeaad4feefd708a386df Mon Sep 17 00:00:00 2001 From: HAOCHENYE <21724054@zju.edu.cn> Date: Fri, 25 Oct 2024 15:37:32 +0800 Subject: [PATCH 1/2] [Fix] Fix is builtin_module --- mmengine/config/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mmengine/config/utils.py b/mmengine/config/utils.py index 81b58fb49a..db23eab0a1 100644 --- a/mmengine/config/utils.py +++ b/mmengine/config/utils.py @@ -168,6 +168,8 @@ def _is_builtin_module(module_name: str) -> bool: return True if module_name in sys.builtin_module_names: return True + if sys.version_info >= (3, 10) and module_name in sys.stdlib_module_names(): + return True spec = find_spec(module_name.split('.')[0]) # Module not found if spec is None: From 0a1dd07f76e7caf31bb072ae56db845cf730bc20 Mon Sep 17 00:00:00 2001 From: HAOCHENYE <21724054@zju.edu.cn> Date: Fri, 25 Oct 2024 17:08:19 +0800 Subject: [PATCH 2/2] [Fix] Fix lint --- mmengine/config/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mmengine/config/utils.py b/mmengine/config/utils.py index db23eab0a1..c8dd803870 100644 --- a/mmengine/config/utils.py +++ b/mmengine/config/utils.py @@ -168,7 +168,8 @@ def _is_builtin_module(module_name: str) -> bool: return True if module_name in sys.builtin_module_names: return True - if sys.version_info >= (3, 10) and module_name in sys.stdlib_module_names(): + if sys.version_info >= ( + 3, 10) and module_name in sys.stdlib_module_names(): return True spec = find_spec(module_name.split('.')[0]) # Module not found