From c16b3d4d390652f2f4d66ffba511a2d44f4f450a Mon Sep 17 00:00:00 2001 From: nyanpasu64 Date: Fri, 8 Mar 2019 15:44:31 -0800 Subject: [PATCH] Use absolute path for CProfile output file --- corrscope/cli.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/corrscope/cli.py b/corrscope/cli.py index 83ca5bb..6f808ae 100644 --- a/corrscope/cli.py +++ b/corrscope/cli.py @@ -240,9 +240,10 @@ def get_profile_dump_name(prefix: str) -> str: profile_dump_name = f"{prefix}-{PROFILE_DUMP_NAME}-{now_str}" # Write stats to unused filename - for path in add_numeric_suffixes(profile_dump_name): - if not Path(path).exists(): - return path + for name in add_numeric_suffixes(profile_dump_name): + abs_path = Path(name).resolve() + if not abs_path.exists(): + return str(abs_path) assert False # never happens since add_numeric_suffixes is endless.