This commit is contained in:
Israël Hallé 2024-07-03 16:59:18 -04:00 committed by GitHub
commit 932df691f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -531,7 +531,7 @@ def import_path(
# Try to import this module using the standard import mechanisms, but
# without touching sys.path.
try:
pkg_root, module_name = resolve_pkg_root_and_module_name(
_, module_name = resolve_pkg_root_and_module_name(
path, consider_namespace_packages=consider_namespace_packages
)
except CouldNotResolvePathError:
@ -542,7 +542,7 @@ def import_path(
return sys.modules[module_name]
mod = _import_module_using_spec(
module_name, path, pkg_root, insert_modules=False
module_name, path, path.parent, insert_modules=False
)
if mod is not None:
return mod