summaryrefslogtreecommitdiffstats
path: root/Lib/ftplib.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2002-05-31 14:13:04 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2002-05-31 14:13:04 (GMT)
commit7ce734cd72bc32b5062f90f37fbe0cbc3c0e104e (patch)
tree567723f528cd14f51e7744b981935bbda03fe024 /Lib/ftplib.py
parent05ab2e693cf5bed23e14058cf9eb458441769122 (diff)
downloadcpython-7ce734cd72bc32b5062f90f37fbe0cbc3c0e104e.zip
cpython-7ce734cd72bc32b5062f90f37fbe0cbc3c0e104e.tar.gz
cpython-7ce734cd72bc32b5062f90f37fbe0cbc3c0e104e.tar.bz2
Use string methods where possible, and remove import string
Diffstat (limited to 'Lib/ftplib.py')
-rw-r--r--Lib/ftplib.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/ftplib.py b/Lib/ftplib.py
index 2ccfbcb..21b9e52 100644
--- a/Lib/ftplib.py
+++ b/Lib/ftplib.py
@@ -36,7 +36,6 @@ python ftplib.py -d localhost -l -p -l
import os
import sys
-import string
# Import SOCKS module if it exists, else standard socket module socket
try:
@@ -266,7 +265,7 @@ class FTP:
if af == 0:
raise error_proto, 'unsupported address family'
fields = ['', `af`, host, `port`, '']
- cmd = 'EPRT ' + string.joinfields(fields, '|')
+ cmd = 'EPRT ' + '|'.join(fields)
return self.voidcmd(cmd)
def makeport(self):
@@ -585,18 +584,18 @@ def parse229(resp, peer):
if resp[:3] <> '229':
raise error_reply, resp
- left = string.find(resp, '(')
+ left = resp.find('(')
if left < 0: raise error_proto, resp
- right = string.find(resp, ')', left + 1)
+ right = resp.find(')', left + 1)
if right < 0:
raise error_proto, resp # should contain '(|||port|)'
if resp[left + 1] <> resp[right - 1]:
raise error_proto, resp
- parts = string.split(resp[left + 1:right], resp[left+1])
+ parts = resp[left+1].split(resp[left + 1:right])
if len(parts) <> 5:
raise error_proto, resp
host = peer[0]
- port = string.atoi(parts[3])
+ port = int(parts[3])
return host, port