Browse Source

Fix profile data saving

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

8
korman/operators/op_export.py

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

Loading…
Cancel
Save