Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 889bb29

Browse files
committed
Closes #13807: Now checks for sys.stderr being there before writing to it.
1 parent b462da8 commit 889bb29

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/logging/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ def handleError(self, record):
721721
You could, however, replace this with a custom handler if you wish.
722722
The record which was being processed is passed in to this method.
723723
"""
724-
if raiseExceptions:
724+
if raiseExceptions and sys.stderr: # see issue 13807
725725
ei = sys.exc_info()
726726
try:
727727
traceback.print_exception(ei[0], ei[1], ei[2], None, sys.stderr)

0 commit comments

Comments
 (0)