From b6b0e5b6b8af88c08d1a7ab269c03be8e15d312f Mon Sep 17 00:00:00 2001 From: danielryckman Date: Thu, 4 Jun 2026 14:05:21 -0400 Subject: [PATCH] fixed module parsing if the module and current directory are named the same --- traincheck/instrumentor/tracer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/traincheck/instrumentor/tracer.py b/traincheck/instrumentor/tracer.py index 8a6ac1e1..86621e1f 100644 --- a/traincheck/instrumentor/tracer.py +++ b/traincheck/instrumentor/tracer.py @@ -523,7 +523,7 @@ def get_module_path_from_file_path(file_path: str, root_module: str) -> str | No ): return None # get the path of the module from the file path - path_after_root_module = file_path.split(f"/{root_module}/")[1].split(".py")[0] + path_after_root_module = file_path.rsplit(f"/{root_module}/", 1)[-1].split(".py")[0] module_path = f"{root_module}.{path_after_root_module}".replace("/", ".") return module_path