Skip to content

ZeroDivisionError: float division by zero #9

@cpys

Description

@cpys

when i try to render the svg file by myself, i got exception like this

  File "profmiddleware.py", line 37, in post_prof
    flameprof.render(pr.stats, flameprof.get_out(svg_file_name))
  File "/home/cpys/anaconda3/lib/python3.8/site-packages/flameprof.py", line 305, in render
    blocks, bblocks, maxw = prepare(funcs, calls, threshold=threshold)
  File "/home/cpys/anaconda3/lib/python3.8/site-packages/flameprof.py", line 232, in prepare
    _calc_back((f for f in funcs if f != 'root'), 0, None, 0, set(), 0)
  File "/home/cpys/anaconda3/lib/python3.8/site-packages/flameprof.py", line 225, in _calc_back
    _calc_back(func['called'], level+1, name, origin, visited | {key}, ttt)
  File "/home/cpys/anaconda3/lib/python3.8/site-packages/flameprof.py", line 225, in _calc_back
    _calc_back(func['called'], level+1, name, origin, visited | {key}, ttt)
  File "/home/cpys/anaconda3/lib/python3.8/site-packages/flameprof.py", line 225, in _calc_back
    _calc_back(func['called'], level+1, name, origin, visited | {key}, ttt)
  [Previous line repeated 2 more times]
  File "/home/cpys/anaconda3/lib/python3.8/site-packages/flameprof.py", line 199, in _calc_back
    factor = pw / sum(calls[(r, to)][3] for r in names)
ZeroDivisionError: float division by zero
flameprof.render(pr.stats, flameprof.get_out(svg_file_name))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions