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

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Initialize handler with io.StringIO()
  • Loading branch information
xu-song committed Dec 23, 2023
commit 5313957f97d78140f09f2c53e4254842dbb61b91
2 changes: 1 addition & 1 deletion Lib/test/_test_multiprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4727,7 +4727,7 @@ def test_level(self):
def test_format(self):
logger = multiprocessing.get_logger()
logger.setLevel(util.DEBUG)
handler = logging.StreamHandler()
handler = logging.StreamHandler(io.StringIO())
logging_format = '[%(levelname)s] [%(processName)s] [%(filename)s:%(lineno)d:%(funcName)s] %(message)s'
handler.setFormatter(logging.Formatter(logging_format))
logger.addHandler(handler)
Expand Down