mirror of
https://github.com/python/cpython.git
synced 2025-10-31 21:51:50 +00:00
Fixes for Python 1.6 compatibility - socket bind and connect get a
tuple instead two arguments.
This commit is contained in:
parent
21afd01ce2
commit
9a580c440c
1 changed files with 2 additions and 2 deletions
|
|
@ -328,7 +328,7 @@ def __init__(self, port=None, connection_hook=None):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.wellknown = s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
self.wellknown = s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
s.bind('', self.port)
|
s.bind(('', self.port))
|
||||||
s.listen(3)
|
s.listen(3)
|
||||||
except:
|
except:
|
||||||
raise connectionLost
|
raise connectionLost
|
||||||
|
|
@ -361,7 +361,7 @@ def rpc_loop(self):
|
||||||
def Client(ip='127.0.0.1', port=None):
|
def Client(ip='127.0.0.1', port=None):
|
||||||
try:
|
try:
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
s.connect(ip,port or Server.default_port)
|
s.connect((ip,port or Server.default_port))
|
||||||
except socket.error, what:
|
except socket.error, what:
|
||||||
raise connectionLost(str(what))
|
raise connectionLost(str(what))
|
||||||
except:
|
except:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue