Pass object-name to loader to fix logging
This commit is contained in:
parent
d785d76370
commit
ea4db0ffb6
@ -29,7 +29,8 @@ class IResolver(object):
|
||||
"""
|
||||
|
||||
# Generate spec based on absolute path
|
||||
spec = importlib.util.spec_from_file_location('unknown', str(module_path))
|
||||
# Pass object_name as first argument to have logging print a reasonable name.
|
||||
spec = importlib.util.spec_from_file_location(object_name, str(module_path))
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
try:
|
||||
spec.loader.exec_module(module) # type: ignore # importlib does not use typehints
|
||||
|
Loading…
Reference in New Issue
Block a user