Skip to content

Commit aac3d93

Browse files
committed
Fix URL parsing with Python 3.8.1 and 2.7.15
1 parent be1251a commit aac3d93

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tests/test_url_parsing.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,15 @@ def test_scheme_only(self):
4040

4141
def test_no_scheme1(self):
4242
u = URL("google.com:80")
43-
assert u.scheme == ""
44-
assert u.host is None
45-
assert u.path == "google.com:80"
43+
# See: https://bugs.python.org/issue27657
44+
if sys.version_info >= (3, 8, 1) or sys.version_info >= (2, 7, 15):
45+
assert u.scheme == "google.com"
46+
assert u.host is None
47+
assert u.path == "80"
48+
else:
49+
assert u.scheme == ""
50+
assert u.host is None
51+
assert u.path == "google.com:80"
4652
assert u.query_string == ""
4753
assert u.fragment == ""
4854

0 commit comments

Comments
 (0)