Skip to content

Commit 0436208

Browse files
committed
libtmux(fix[logging]): remove exc_info from catch-log-reraise
why: exc_info=True duplicates the traceback when followed by raise. The extra={"tmux_cmd": ...} satisfies the AGENTS.md carve-out for adding context that would otherwise be lost. what: - Remove exc_info=True from logger.error in tmux_cmd.__init__ - Add noqa: TRY400 since error() without exc_info in except is intentional
1 parent 03fe61d commit 0436208

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/libtmux/common.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,9 +270,8 @@ def __init__(self, *args: t.Any) -> None:
270270
stdout, stderr = self.process.communicate()
271271
returncode = self.process.returncode
272272
except Exception:
273-
logger.error(
273+
logger.error( # noqa: TRY400
274274
"tmux subprocess failed",
275-
exc_info=True,
276275
extra={
277276
"tmux_cmd": subprocess.list2cmdline(cmd),
278277
},

0 commit comments

Comments
 (0)