mirror of
https://github.com/progval/Limnoria.git
synced 2025-04-25 12:31:04 -05:00
Use cProfile instead of profile
I can't open .prof files created with 'profile' using pyprof2calltree: ``` Traceback (most recent call last): File "/home/val/.local/bin/pyprof2calltree", line 8, in <module> sys.exit(main()) ^^^^^^ File "/home/val/.local/lib/python3.11/site-packages/pyprof2calltree.py", line 339, in main kg = CalltreeConverter(pstats.Stats(args.infile)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/val/.local/lib/python3.11/site-packages/pyprof2calltree.py", line 178, in __init__ self.entries = pstats2entries(profiling_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/val/.local/lib/python3.11/site-packages/pyprof2calltree.py", line 135, in pstats2entries cc, nc, tt, ct = call_info ^^^^^^^^^^^^^^ TypeError: cannot unpack non-iterable int object ```
This commit is contained in:
parent
bb120edbb1
commit
72e90b6972
@ -361,11 +361,11 @@ def main():
|
||||
owner = Owner.Class()
|
||||
|
||||
if options.profile:
|
||||
import profile
|
||||
import cProfile
|
||||
world.profiling = True
|
||||
profile.runctx('run()',
|
||||
globals=globals(), locals={**locals(), "run": run},
|
||||
filename='%s-%i.prof' % (nick, time.time()))
|
||||
cProfile.runctx('run()',
|
||||
globals=globals(), locals={**locals(), "run": run},
|
||||
filename='%s-%i.prof' % (nick, time.time()))
|
||||
else:
|
||||
run()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user