Fix --profile

Broken by 0572d499883ba1f320a01f0125b00c5962fdc2cd
This commit is contained in:
Valentin Lorentz 2024-08-01 22:39:56 +02:00
parent 10a341c70c
commit bb120edbb1

View File

@ -363,7 +363,9 @@ def main():
if options.profile:
import profile
world.profiling = True
profile.run('run()', '%s-%i.prof' % (nick, time.time()))
profile.runctx('run()',
globals=globals(), locals={**locals(), "run": run},
filename='%s-%i.prof' % (nick, time.time()))
else:
run()