From f95a9d34d6f1af7eed5be7e9fb68fe8a10220d68 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Mon, 10 Dec 2018 01:03:35 -0500 Subject: [PATCH] Fix empty profile log files --- korman/operators/op_export.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/korman/operators/op_export.py b/korman/operators/op_export.py index c31cfa5..d137410 100644 --- a/korman/operators/op_export.py +++ b/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"}