Skip to content

Commit 8d29609

Browse files
committed
Fix django-commons#2011: Test the divisor, not the dividend for zero
1 parent 22c92e4 commit 8d29609

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

debug_toolbar/panels/profiling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def subfuncs(self):
9090
count = len(self.statobj.all_callees[self.func])
9191
for i, (func, stats) in enumerate(self.statobj.all_callees[self.func].items()):
9292
h1 = h + ((i + 1) / count) / (self.depth + 1)
93-
s1 = 0 if stats[3] == 0 else s * (stats[3] / self.stats[3])
93+
s1 = 0 if self.stats[3] == 0 else s * (stats[3] / self.stats[3])
9494
yield FunctionCall(
9595
self.statobj,
9696
func,

0 commit comments

Comments
 (0)