Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9a580c4

Browse files
author
Nicholas Riley
committed
Fixes for Python 1.6 compatibility - socket bind and connect get a
tuple instead two arguments.
1 parent 21afd01 commit 9a580c4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/idlelib/protocol.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def __init__(self, port=None, connection_hook=None):
328328

329329
try:
330330
self.wellknown = s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
331-
s.bind('', self.port)
331+
s.bind(('', self.port))
332332
s.listen(3)
333333
except:
334334
raise connectionLost
@@ -361,7 +361,7 @@ def rpc_loop(self):
361361
def Client(ip='127.0.0.1', port=None):
362362
try:
363363
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
364-
s.connect(ip,port or Server.default_port)
364+
s.connect((ip,port or Server.default_port))
365365
except socket.error, what:
366366
raise connectionLost(str(what))
367367
except:

0 commit comments

Comments
 (0)