Skip to content

Commit

Permalink
pythongh-112414: Fix repr for custom loader
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Nov 27, 2023
1 parent 0d1cbff commit e21726d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lib/importlib/_bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,9 @@ def _module_repr_from_spec(spec):
if spec.origin is None:
if spec.loader is None:
return f'<module {name!r}>'
else:
if isinstance(spec.loader, _bootstrap_external.NamespaceLoader):
return f'<module {name!r} (namespace) from {list(spec.loader._path)}>'
return f'<module {name!r} ({spec.loader!r})>'
else:
if spec.has_location:
return f'<module {name!r} from {spec.origin!r}>'
Expand Down

0 comments on commit e21726d

Please sign in to comment.