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)
This commit is contained in:
Vinay Sajip 2007-01-08 18:50:32 +00:00
parent 51c2f6cd18
commit c683a87ca6
1 changed files with 2 additions and 2 deletions

View File

@ -343,7 +343,7 @@ class SocketHandler(logging.Handler):
try: try:
self.sock = self.makeSocket() self.sock = self.makeSocket()
self.retryTime = None # next time, no delay before trying self.retryTime = None # next time, no delay before trying
except: except socket.error:
#Creation failed, so set the retry time and return. #Creation failed, so set the retry time and return.
if self.retryTime is None: if self.retryTime is None:
self.retryPeriod = self.retryStart self.retryPeriod = self.retryStart
@ -734,7 +734,7 @@ class SMTPHandler(logging.Handler):
import smtplib import smtplib
try: try:
from email.Utils import formatdate from email.Utils import formatdate
except: except ImportError:
formatdate = self.date_time formatdate = self.date_time
port = self.mailport port = self.mailport
if not port: if not port: