Skip to content

Commit

Permalink
Fix #2011: Test the divisor, not the dividend for zero (#2015)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask authored Oct 14, 2024
1 parent 22c92e4 commit 4ad55f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion debug_toolbar/panels/profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def subfuncs(self):
count = len(self.statobj.all_callees[self.func])
for i, (func, stats) in enumerate(self.statobj.all_callees[self.func].items()):
h1 = h + ((i + 1) / count) / (self.depth + 1)
s1 = 0 if stats[3] == 0 else s * (stats[3] / self.stats[3])
s1 = 0 if self.stats[3] == 0 else s * (stats[3] / self.stats[3])
yield FunctionCall(
self.statobj,
func,
Expand Down

0 comments on commit 4ad55f7

Please sign in to comment.