Skip to content

Commit e7a2f76

Browse files
committed
Fix test_ftp for Python 3.8+
1 parent 32641e1 commit e7a2f76

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/test_future/test_urllib2.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -691,10 +691,6 @@ def connect_ftp(self, user, passwd, host, port, dirs,
691691
h = NullFTPHandler(data)
692692
h.parent = MockOpener()
693693

694-
# MIME guessing works in Python 3.8!
695-
guessed_mime = None
696-
if sys.hexversion >= 0x03080000:
697-
guessed_mime = "image/gif"
698694
for url, host, port, user, passwd, type_, dirs, filename, mimetype in [
699695
("ftp://localhost/foo/bar/baz.html",
700696
"localhost", ftplib.FTP_PORT, "", "", "I",
@@ -713,7 +709,10 @@ def connect_ftp(self, user, passwd, host, port, dirs,
713709
["foo", "bar"], "", None),
714710
("ftp://localhost/baz.gif;type=a",
715711
"localhost", ftplib.FTP_PORT, "", "", "A",
716-
[], "baz.gif", guessed_mime),
712+
[], "baz.gif", None),
713+
("ftp://localhost/baz.gif",
714+
"localhost", ftplib.FTP_PORT, "", "", "I",
715+
[], "baz.gif", "image/gif"),
717716
]:
718717
req = Request(url)
719718
req.timeout = None

0 commit comments

Comments
 (0)