summaryrefslogtreecommitdiffstats
path: root/Demo/sockets/ftp.py
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2000-08-25 15:38:41 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2000-08-25 15:38:41 (GMT)
commita8d30d5d667b32b1b296c0926a0e80709bd6fab3 (patch)
treea68f728c1c466ea08e04c3dcf08e2cafa2746132 /Demo/sockets/ftp.py
parent239f836c10425bb2514284dd4eb4fc63b206b587 (diff)
downloadcpython-a8d30d5d667b32b1b296c0926a0e80709bd6fab3.zip
cpython-a8d30d5d667b32b1b296c0926a0e80709bd6fab3.tar.gz
cpython-a8d30d5d667b32b1b296c0926a0e80709bd6fab3.tar.bz2
update demo scripts to use addr tuples for bind and connect
closes bug #111928
Diffstat (limited to 'Demo/sockets/ftp.py')
-rwxr-xr-xDemo/sockets/ftp.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Demo/sockets/ftp.py b/Demo/sockets/ftp.py
index 2d49239..8260c52 100755
--- a/Demo/sockets/ftp.py
+++ b/Demo/sockets/ftp.py
@@ -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