Skip to content

Commit 0d0132b

Browse files
yanjostmatthiask
authored andcommitted
Fix crash in profiling when no directory name found
1 parent 62c191a commit 0d0132b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

debug_toolbar/panels/profiling.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ def func_std_string(self): # match what old profile produced
7676
if idx > -1:
7777
file_name = file_name[(idx + 14):]
7878

79-
file_path, file_name = file_name.rsplit(os.sep, 1)
79+
split_path = file_name.rsplit(os.sep, 1)
80+
if len(split_path) > 1:
81+
file_path, file_name = file_name.rsplit(os.sep, 1)
82+
else:
83+
file_path = '<module>'
8084

8185
return format_html(
8286
'<span class="djdt-path">{0}/</span>'

0 commit comments

Comments
 (0)