Skip to content

Commit b0a7fd8

Browse files
committed
fixup! fixup! Port the tree reporter to textual
1 parent 0d17174 commit b0a7fd8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/memray/reporters/tree.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from textual.dom import DOMNode
2020
from textual.screen import ModalScreen
2121
from textual.widgets import Footer
22-
from textual.widgets import Header
2322
from textual.widgets import Label
2423
from textual.widgets import ListItem
2524
from textual.widgets import ListView
@@ -33,6 +32,7 @@
3332
from memray.reporters.frame_tools import is_cpython_internal
3433
from memray.reporters.frame_tools import is_frame_from_import_system
3534
from memray.reporters.frame_tools import is_frame_interesting
35+
from memray.reporters.tui import _filename_to_module_name
3636

3737
MAX_STACKS = int(sys.getrecursionlimit() // 2.5)
3838

@@ -196,7 +196,9 @@ def create_tree(
196196
size=size_str,
197197
info_color=_info_color(node, root_data),
198198
function=function,
199-
code_position=f"{file}:{lineno}" if lineno != 0 else file,
199+
code_position=f"{_filename_to_module_name(file)}:{lineno}"
200+
if lineno != 0
201+
else file,
200202
)
201203
)
202204
children = tuple(node.children.values())

0 commit comments

Comments
 (0)