amend for python 3.x switch: BrokenPipeError is a build-in exception since 3.3

pull/3381/head
sebres 2023-12-22 14:05:04 +01:00
parent 093cd763ce
commit 7523a777f0
2 changed files with 1 additions and 3 deletions

View File

@ -27,7 +27,7 @@ import sys
from ..version import version, normVersion from ..version import version, normVersion
from ..protocol import printFormatted from ..protocol import printFormatted
from ..helpers import getLogger, str2LogLevel, getVerbosityFormat, BrokenPipeError from ..helpers import getLogger, str2LogLevel, getVerbosityFormat
# Gets the instance of the logger. # Gets the instance of the logger.
logSys = getLogger("fail2ban") logSys = getLogger("fail2ban")

View File

@ -183,8 +183,6 @@ def __stopOnIOError(logSys=None, logHndlr=None): # pragma: no cover
pass pass
sys.exit(0) sys.exit(0)
BrokenPipeError = BrokenPipeError
__origLog = logging.Logger._log __origLog = logging.Logger._log
def __safeLog(self, level, msg, args, **kwargs): def __safeLog(self, level, msg, args, **kwargs):
"""Safe log inject to avoid possible errors by unsafe log-handlers, """Safe log inject to avoid possible errors by unsafe log-handlers,