Skip to content

Commit

Permalink
[Fix] Fix is builtin_module
Browse files Browse the repository at this point in the history
  • Loading branch information
HAOCHENYE committed Oct 25, 2024
1 parent c9b5996 commit 64ae9e5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mmengine/config/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from mmengine.fileio import load
from mmengine.utils import check_file_exist
from mmengine.utils.version_utils import digit_version

PYTHON_ROOT_DIR = osp.dirname(osp.dirname(sys.executable))
SYSTEM_PYTHON_PREFIX = '/usr/lib/python'
Expand Down Expand Up @@ -168,6 +169,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:
Expand Down

0 comments on commit 64ae9e5

Please sign in to comment.