mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
update demo scripts to use addr tuples for bind and connect
closes bug #111928
This commit is contained in:
parent
239f836c10
commit
a8d30d5d66
6 changed files with 9 additions and 9 deletions
|
@ -48,7 +48,7 @@ def control(hostname):
|
|||
# Create control connection
|
||||
#
|
||||
s = socket(AF_INET, SOCK_STREAM)
|
||||
s.connect(hostname, FTP_PORT)
|
||||
s.connect((hostname, FTP_PORT))
|
||||
f = s.makefile('r') # Reading the replies is easier from a file...
|
||||
#
|
||||
# Control loop
|
||||
|
@ -79,7 +79,7 @@ def newdataport(s, f):
|
|||
port = nextport + FTP_DATA_PORT
|
||||
nextport = (nextport+1) % 16
|
||||
r = socket(AF_INET, SOCK_STREAM)
|
||||
r.bind(gethostbyname(gethostname()), port)
|
||||
r.bind((gethostbyname(gethostname()), port))
|
||||
r.listen(1)
|
||||
sendportcmd(s, f, port)
|
||||
return r
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue