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:
parent
51c2f6cd18
commit
c683a87ca6
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue