summaryrefslogtreecommitdiffstats
path: root/Lib/smtplib.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-17 16:55:10 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-17 16:55:10 (GMT)
commit3b69824de9860899372d3b816a0601889e2a0031 (patch)
tree2871b2bcaa8a7be87a194ee197c57bbcaabc6a0c /Lib/smtplib.py
parent896cb15d0c4a32775cbead257ae85047b5bdba14 (diff)
parentb6693c4604f995ce965ede2f6a8f5b4252a1fa28 (diff)
downloadcpython-3b69824de9860899372d3b816a0601889e2a0031.zip
cpython-3b69824de9860899372d3b816a0601889e2a0031.tar.gz
cpython-3b69824de9860899372d3b816a0601889e2a0031.tar.bz2
Issue #16647: save socket error details in LMTP.connect()
Patch by Serhiy Storchaka.
Diffstat (limited to 'Lib/smtplib.py')
-rw-r--r--Lib/smtplib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/smtplib.py b/Lib/smtplib.py
index d37b0e2..c949d77 100644
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -920,13 +920,13 @@ class LMTP(SMTP):
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.file = None
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)