From b6693c4604f995ce965ede2f6a8f5b4252a1fa28 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Mon, 17 Dec 2012 18:54:53 +0200 Subject: [PATCH] Issue #16647: save socket error details in LMTP.connect() Patch by Serhiy Storchaka. --- Lib/smtplib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/smtplib.py b/Lib/smtplib.py index fbef96e691f..e06a9be7413 100644 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py @@ -892,13 +892,13 @@ class LMTP(SMTP): try: self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) self.sock.connect(host) - except socket.error as msg: + except socket.error: if self.debuglevel > 0: print('connect fail:', host, file=stderr) if self.sock: self.sock.close() self.sock = None - raise socket.error(msg) + raise (code, msg) = self.getreply() if self.debuglevel > 0: print('connect:', msg, file=stderr)