summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/nntplib.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/nntplib.py b/Lib/nntplib.py
index 4d7f9fd..6ac2fcb 100644
--- a/Lib/nntplib.py
+++ b/Lib/nntplib.py
@@ -109,8 +109,7 @@ class NNTP:
"""
self.host = host
self.port = port
- self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- self.sock.connect((self.host, self.port))
+ self.sock = socket.create_connection((host, port))
self.file = self.sock.makefile('rb')
self.debugging = 0
self.welcome = self.getresp()