summaryrefslogtreecommitdiffstats
path: root/Lib/smtplib.py
diff options
context:
space:
mode:
authorRoss <rrhodes@users.noreply.github.com>2021-01-01 17:20:25 (GMT)
committerGitHub <noreply@github.com>2021-01-01 17:20:25 (GMT)
commit3bf05327c2b25d42b92795d9d280288c22a0963d (patch)
tree608f0d4a616d760f154d4a8a73e837e5fc92fb30 /Lib/smtplib.py
parentde6f20a6de48d63066b2cf5b317f50629f01d74a (diff)
downloadcpython-3bf05327c2b25d42b92795d9d280288c22a0963d.zip
cpython-3bf05327c2b25d42b92795d9d280288c22a0963d.tar.gz
cpython-3bf05327c2b25d42b92795d9d280288c22a0963d.tar.bz2
bpo-42756: Configure LMTP Unix-domain socket to use global default timeout when timeout not provided (GH-23969)
Diffstat (limited to 'Lib/smtplib.py')
-rwxr-xr-xLib/smtplib.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/smtplib.py b/Lib/smtplib.py
index e2dbbbc..e81a9f0 100755
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -1082,7 +1082,8 @@ class LMTP(SMTP):
# Handle Unix-domain sockets.
try:
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
- self.sock.settimeout(self.timeout)
+ if self.timeout is not socket._GLOBAL_DEFAULT_TIMEOUT:
+ self.sock.settimeout(self.timeout)
self.file = None
self.sock.connect(host)
except OSError: