From 7523a777f07bf0ea360b94a6ecb5667fd58ae47d Mon Sep 17 00:00:00 2001 From: sebres Date: Fri, 22 Dec 2023 14:05:04 +0100 Subject: [PATCH] amend for python 3.x switch: BrokenPipeError is a build-in exception since 3.3 --- fail2ban/client/fail2bancmdline.py | 2 +- fail2ban/helpers.py | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/fail2ban/client/fail2bancmdline.py b/fail2ban/client/fail2bancmdline.py index c2f6d0be..62008288 100644 --- a/fail2ban/client/fail2bancmdline.py +++ b/fail2ban/client/fail2bancmdline.py @@ -27,7 +27,7 @@ import sys from ..version import version, normVersion from ..protocol import printFormatted -from ..helpers import getLogger, str2LogLevel, getVerbosityFormat, BrokenPipeError +from ..helpers import getLogger, str2LogLevel, getVerbosityFormat # Gets the instance of the logger. logSys = getLogger("fail2ban") diff --git a/fail2ban/helpers.py b/fail2ban/helpers.py index b864fd15..fe62ae1e 100644 --- a/fail2ban/helpers.py +++ b/fail2ban/helpers.py @@ -183,8 +183,6 @@ def __stopOnIOError(logSys=None, logHndlr=None): # pragma: no cover pass sys.exit(0) -BrokenPipeError = BrokenPipeError - __origLog = logging.Logger._log def __safeLog(self, level, msg, args, **kwargs): """Safe log inject to avoid possible errors by unsafe log-handlers,