diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2007-01-08 18:50:32 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2007-01-08 18:50:32 (GMT) |
commit | c683a87ca6d026e33c07758bf4802c009727b5f2 (patch) | |
tree | faa69574b157d2fc039fd79f39ac4ccb34c88395 /Lib/logging | |
parent | 51c2f6cd180df4acd4eec6317b46ef38a2bebe16 (diff) | |
download | cpython-c683a87ca6d026e33c07758bf4802c009727b5f2.zip cpython-c683a87ca6d026e33c07758bf4802c009727b5f2.tar.gz cpython-c683a87ca6d026e33c07758bf4802c009727b5f2.tar.bz2 |
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)
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/handlers.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 4ef896e..cd8d5d2 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: |