File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,15 @@ def _register_builtin_types(self) -> None:
6464
6565 # -------------------------------------------------------------------- paths
6666 def _register_path (self , path : str ) -> int :
67+ """Register a source file path and emit a ``Path`` event."""
68+
69+ if path :
70+ abs_path = os .path .abspath (path )
71+ try :
72+ path = os .path .relpath (abs_path , self .program_dir )
73+ except ValueError :
74+ path = abs_path
75+
6776 if path not in self .path_map :
6877 self .path_map [path ] = len (self .paths )
6978 self .paths .append (path )
Original file line number Diff line number Diff line change 6161 }
6262 },
6363 {
64- "Path" : " /workspace/codetracer-python-recorder/tests/programs/ array_sum.py"
64+ "Path" : " array_sum.py"
6565 },
6666 {
6767 "Function" : {
Original file line number Diff line number Diff line change 6161 }
6262 },
6363 {
64- "Path" : " /workspace/codetracer-python-recorder/tests/programs/ calc.py"
64+ "Path" : " calc.py"
6565 },
6666 {
6767 "Function" : {
You can’t perform that action at this time.
0 commit comments