From c683a87ca6d026e33c07758bf4802c009727b5f2 Mon Sep 17 00:00:00 2001 From: Vinay Sajip Date: Mon, 8 Jan 2007 18:50:32 +0000 Subject: [PATCH] Bare except clause removed from SMTPHandler.emit(). Now, only ImportError is trapped. Bare except clause removed from SocketHandler.createSocket(). Now, only socket.error is trapped. (SF #411881) --- Lib/logging/handlers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 4ef896ed5d6..cd8d5d2f746 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -343,7 +343,7 @@ class SocketHandler(logging.Handler): try: self.sock = self.makeSocket() self.retryTime = None # next time, no delay before trying - except: + except socket.error: #Creation failed, so set the retry time and return. if self.retryTime is None: self.retryPeriod = self.retryStart @@ -734,7 +734,7 @@ class SMTPHandler(logging.Handler): import smtplib try: from email.Utils import formatdate - except: + except ImportError: formatdate = self.date_time port = self.mailport if not port: