summaryrefslogtreecommitdiff
path: root/fs/ftpfs.py
diff options
context:
space:
mode:
authorwillmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f>2010-12-12 19:45:18 +0000
committerwillmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f>2010-12-12 19:45:18 +0000
commit7f1e44a30fe22542705642381620ae1fc2e64e12 (patch)
tree84af17dc03a01eae8d0894d0ef555eb20d8ef83c /fs/ftpfs.py
parent910935343d0d212806234eb11989d190d978c2bd (diff)
downloadpyfilesystem-git-7f1e44a30fe22542705642381620ae1fc2e64e12.tar.gz
Added fsmount command, made memroyfs work with threads
Diffstat (limited to 'fs/ftpfs.py')
-rw-r--r--fs/ftpfs.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/ftpfs.py b/fs/ftpfs.py
index c9dece3..f4cd1b2 100644
--- a/fs/ftpfs.py
+++ b/fs/ftpfs.py
@@ -17,11 +17,9 @@ from fs.remote import RemoteFileBuffer
from ftplib import FTP, error_perm, error_temp, error_proto, error_reply
try:
- from ftplib import _GLOBAL_DEFAULT_TIMEOUT
- _FTPLIB_TIMEOUT = True
+ from ftplib import _GLOBAL_DEFAULT_TIMEOUT
except ImportError:
- _GLOBAL_DEFAULT_TIMEOUT = None
- _FTPLIB_TIMEOUT = False
+ _GLOBAL_DEFAULT_TIMEOUT = object()
import threading
from time import sleep
@@ -934,7 +932,7 @@ class FTPFS(FS):
def _open_ftp(self):
try:
ftp = FTP()
- if _FTPLIB_TIMEOUT:
+ if self.timeout is not _GLOBAL_DEFAULT_TIMEOUT:
ftp.connect(self.host, self.port, self.timeout)
else:
ftp.connect(self.host, self.port)