fix check builtin module

This commit is contained in:
HAOCHENYE 2024-09-11 10:44:09 +00:00
parent 85c83ba616
commit dc39d6d4c1

View File

@ -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