Skip to content

Commit 89d9f7b

Browse files
committed
FTPFS: Type checker fixes.
1 parent 831979c commit 89d9f7b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/ftpfs.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
try:
1919
from ftplib import FTP_TLS
2020
except ImportError as err:
21-
FTP_TLS = err
21+
FTP_TLS = err # type: ignore
2222
from ftplib import error_perm
2323
from ftplib import error_temp
2424
from typing import cast
@@ -472,8 +472,10 @@ def _open_ftp(self):
472472
with ftp_errors(self):
473473
_ftp.connect(self.host, self.port, self.timeout)
474474
_ftp.login(self.user, self.passwd, self.acct)
475-
if self.tls:
475+
try:
476476
_ftp.prot_p()
477+
except AttributeError:
478+
pass
477479
self._features = {}
478480
try:
479481
feat_response = _decode(_ftp.sendcmd("FEAT"), "latin-1")

0 commit comments

Comments
 (0)