summaryrefslogtreecommitdiff
path: root/Lib/ftplib.py
diff options
context:
space:
mode:
authorGiampaolo Rodola' <g.rodola@gmail.com>2013-03-18 09:59:15 +0100
committerGiampaolo Rodola' <g.rodola@gmail.com>2013-03-18 09:59:15 +0100
commita77d7a52e88fdbb3068b99bd15eba8a0aa204529 (patch)
treea45eb9bfdae727d3760786a051cf89c163c92c1e /Lib/ftplib.py
parent0351928359b372a37838980190beecebf5f5c3c7 (diff)
downloadcpython-git-a77d7a52e88fdbb3068b99bd15eba8a0aa204529.tar.gz
(issue 17452 / ftplib) fix TypeError occurring in case ssl module is not installed
Diffstat (limited to 'Lib/ftplib.py')
-rw-r--r--Lib/ftplib.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/ftplib.py b/Lib/ftplib.py
index a7f03e8cc4..c5554f8f69 100644
--- a/Lib/ftplib.py
+++ b/Lib/ftplib.py
@@ -440,7 +440,7 @@ class FTP:
break
callback(data)
# shutdown ssl layer
- if isinstance(conn, _SSLSocket):
+ if _SSLSocket is not None and isinstance(conn, _SSLSocket):
conn.unwrap()
return self.voidresp()
@@ -473,7 +473,7 @@ class FTP:
line = line[:-1]
callback(line)
# shutdown ssl layer
- if isinstance(conn, _SSLSocket):
+ if _SSLSocket is not None and isinstance(conn, _SSLSocket):
conn.unwrap()
return self.voidresp()
@@ -502,7 +502,7 @@ class FTP:
if callback:
callback(buf)
# shutdown ssl layer
- if isinstance(conn, _SSLSocket):
+ if _SSLSocket is not None and isinstance(conn, _SSLSocket):
conn.unwrap()
return self.voidresp()
@@ -531,7 +531,7 @@ class FTP:
if callback:
callback(buf)
# shutdown ssl layer
- if isinstance(conn, _SSLSocket):
+ if _SSLSocket is not None and isinstance(conn, _SSLSocket):
conn.unwrap()
return self.voidresp()