diff options
Diffstat (limited to 'Lib/urllib.py')
-rw-r--r-- | Lib/urllib.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py index 6a7c23f..c6bd87f 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -805,19 +805,20 @@ def noheaders(): class ftpwrapper: """Class used by open_ftp() for cache of open FTP connections.""" - def __init__(self, user, passwd, host, port, dirs): + def __init__(self, user, passwd, host, port, dirs, timeout=None): self.user = user self.passwd = passwd self.host = host self.port = port self.dirs = dirs + self.timeout = timeout self.init() def init(self): import ftplib self.busy = 0 self.ftp = ftplib.FTP() - self.ftp.connect(self.host, self.port) + self.ftp.connect(self.host, self.port, self.timeout) self.ftp.login(self.user, self.passwd) for dir in self.dirs: self.ftp.cwd(dir) |