Skip to content

Commit bfb8be4

Browse files
committed
Don't default Cmd2ExceptionConsole's file to sys.stderr.
1 parent 98e5e90 commit bfb8be4

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

cmd2/cmd2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1507,7 +1507,7 @@ def pexcept(
15071507
:param kwargs: Arbitrary keyword arguments. This allows subclasses to extend the signature of this
15081508
method and still call `super()` without encountering unexpected keyword argument errors.
15091509
"""
1510-
console = Cmd2ExceptionConsole()
1510+
console = Cmd2ExceptionConsole(file=sys.stderr)
15111511

15121512
# Only print a traceback if we're in debug mode and one exists.
15131513
if self.debug and sys.exc_info() != (None, None, None):

cmd2/rich_utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,10 @@ def __init__(self, *, file: IO[str] | None = None) -> None:
243243
"""Cmd2ExceptionConsole initializer.
244244
245245
:param file: optional file object where the console should write to.
246-
If None, output defaults to sys.stderr.
246+
Defaults to sys.stdout.
247247
"""
248-
# Use stderr=True so that Rich defaults to sys.stderr if file is None.
249248
super().__init__(
250249
file=file,
251-
stderr=True,
252250
soft_wrap=False,
253251
markup=False,
254252
emoji=False,

0 commit comments

Comments
 (0)