Skip to content

Commit 7d4f0c8

Browse files
Fix traceback (#1206)
This fixes the traceback output. format_exc does not work in this context.
1 parent a1cfabe commit 7d4f0c8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

amulet_map_editor/programs/edit/api/canvas/edit_canvas.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,17 @@ def _run_operation(
290290
elif isinstance(op.error, BaseSilentException):
291291
pass
292292
elif isinstance(op.error, BaseException):
293-
log.error(traceback.format_exc())
293+
tb = "".join(
294+
traceback.format_exception(
295+
type(op.error), op.error, op.error.__traceback__
296+
)
297+
)
298+
log.error(tb)
294299
dialog = TracebackDialog(
295300
self,
296301
"Exception while running operation",
297302
str(op.error),
298-
traceback.format_exc(),
303+
tb,
299304
)
300305
dialog.ShowModal()
301306
dialog.Destroy()

0 commit comments

Comments
 (0)