Skip to content

Commit

Permalink
Code update
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 712481985
  • Loading branch information
The etils Authors committed Jan 8, 2025
1 parent 6ff7408 commit c6cf381
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion etils/epath/resource_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def resource_path(package: Union[str, types.ModuleType]) -> abstract_path.Path:
# Note this is not the true path (`/google_src/` vs
# `/export/.../server/ml_notebook.runfiles`), but should be equivalent.
if isinstance(package, types.ModuleType):
package = package.__name__
package = package.__spec__.name # pytype: disable=attribute-error
path = pathlib.Path(sys.modules[package].__file__)
if path.name == '__init__.py':
path = path.parent
Expand Down

0 comments on commit c6cf381

Please sign in to comment.