Skip to content

Commit

Permalink
fix check builtin module
Browse files Browse the repository at this point in the history
  • Loading branch information
HAOCHENYE committed Sep 11, 2024
1 parent 85c83ba commit 7720f33
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mmengine/config/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from typing import List, Optional, Tuple, Union

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

PYTHON_ROOT_DIR = osp.dirname(osp.dirname(sys.executable))

Expand Down Expand Up @@ -176,7 +176,8 @@ def _is_builtin_module(module_name: str) -> bool:
return False
origin_path = osp.abspath(origin_path)
if ('site-package' in origin_path or 'dist-package' in origin_path
or not origin_path.startswith(PYTHON_ROOT_DIR)):
or not origin_path.startswith(
(PYTHON_ROOT_DIR, '/usr/lib/python'))):
return False
else:
return True
Expand Down

0 comments on commit 7720f33

Please sign in to comment.