Browse Source

Fix empty profile log files

pull/125/head
Adam Johnson 6 years ago
parent
commit
f95a9d34d6
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 6
      korman/operators/op_export.py

6
korman/operators/op_export.py

@ -137,8 +137,8 @@ class ExportOperator(bpy.types.Operator):
try:
self.export_active = True
if self.profile_export:
profile = path.with_name("{}_cProfile".format(ageName))
profile = cProfile.runctx("e.run()", globals(), locals(), str(profile))
profile_path = str(path.with_name("{}_cProfile".format(ageName)))
profile = cProfile.runctx("e.run()", globals(), locals(), profile_path)
else:
e.run()
except exporter.ExportError as error:
@ -148,7 +148,7 @@ class ExportOperator(bpy.types.Operator):
if self.profile_export:
stats_out = path.with_name("{}_profile.log".format(ageName))
with open(str(stats_out), "w") as out:
stats = pstats.Stats(profile, stream=out)
stats = pstats.Stats(profile_path, stream=out)
stats = stats.sort_stats("time", "calls")
stats.print_stats()
return {"FINISHED"}

Loading…
Cancel
Save