Commit 0f7c0759 authored by Vinay Sajip's avatar Vinay Sajip

Brought excluded code into the scope of a try block in SysLogHandler.emit().

parent fbd77670
...@@ -879,6 +879,7 @@ class SysLogHandler(logging.Handler): ...@@ -879,6 +879,7 @@ class SysLogHandler(logging.Handler):
The record is formatted, and then sent to the syslog server. If The record is formatted, and then sent to the syslog server. If
exception information is present, it is NOT sent to the server. exception information is present, it is NOT sent to the server.
""" """
try:
msg = self.format(record) msg = self.format(record)
if self.ident: if self.ident:
msg = self.ident + msg msg = self.ident + msg
...@@ -893,7 +894,6 @@ class SysLogHandler(logging.Handler): ...@@ -893,7 +894,6 @@ class SysLogHandler(logging.Handler):
# Message is a string. Convert to bytes as required by RFC 5424 # Message is a string. Convert to bytes as required by RFC 5424
msg = msg.encode('utf-8') msg = msg.encode('utf-8')
msg = prio + msg msg = prio + msg
try:
if self.unixsocket: if self.unixsocket:
try: try:
self.socket.send(msg) self.socket.send(msg)
......
...@@ -33,6 +33,9 @@ Core and Builtins ...@@ -33,6 +33,9 @@ Core and Builtins
Library Library
------- -------
- Issue #22776: Brought excluded code into the scope of a try block in
SysLogHandler.emit().
- Issue #22665: Add missing get_terminal_size and SameFileError to - Issue #22665: Add missing get_terminal_size and SameFileError to
shutil.__all__. shutil.__all__.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment