From: Vinay Sajip Date: Mon, 31 Oct 2005 13:14:19 +0000 (+0000) Subject: Exception handling now raises KeyboardInterrupt and SystemExit rather than passing... X-Git-Tag: v2.5a0~1206 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=85c1909a78c97745cd41a56be7bce372b7d60d64;p=thirdparty%2FPython%2Fcpython.git Exception handling now raises KeyboardInterrupt and SystemExit rather than passing to handleError --- diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index ac734e541e04..5a0b0f50213d 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -738,6 +738,8 @@ class StreamHandler(Handler): except UnicodeError: self.stream.write(fs % msg.encode("UTF-8")) self.flush() + except (KeyboardInterrupt, SystemExit): + raise except: self.handleError(record) diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 0182dfede21c..e0ab788f3237 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -71,6 +71,8 @@ class BaseRotatingHandler(logging.FileHandler): if self.shouldRollover(record): self.doRollover() logging.FileHandler.emit(self, record) + except (KeyboardInterrupt, SystemExit): + raise except: self.handleError(record) @@ -418,6 +420,8 @@ class SocketHandler(logging.Handler): try: s = self.makePickle(record) self.send(s) + except (KeyboardInterrupt, SystemExit): + raise except: self.handleError(record) @@ -639,6 +643,8 @@ class SysLogHandler(logging.Handler): self.socket.send(msg) else: self.socket.sendto(msg, self.address) + except (KeyboardInterrupt, SystemExit): + raise except: self.handleError(record)