From a4c9aae6ab6bd904390c289c678c8026d1bc7272 Mon Sep 17 00:00:00 2001 From: The etils Authors Date: Mon, 6 Jan 2025 04:28:57 -0800 Subject: [PATCH] Code update PiperOrigin-RevId: 712481985 --- etils/epath/resource_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etils/epath/resource_utils.py b/etils/epath/resource_utils.py index ab16bca7..40fbe2bb 100644 --- a/etils/epath/resource_utils.py +++ b/etils/epath/resource_utils.py @@ -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