Skip to content

Commit

Permalink
Fix URL parsing with Python 3.8.1 and 2.7.15
Browse files Browse the repository at this point in the history
  • Loading branch information
onovy committed Dec 28, 2019
1 parent be1251a commit aac3d93
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/test_url_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,15 @@ def test_scheme_only(self):

def test_no_scheme1(self):
u = URL("google.com:80")
assert u.scheme == ""
assert u.host is None
assert u.path == "google.com:80"
# See: https://bugs.python.org/issue27657
if sys.version_info >= (3, 8, 1) or sys.version_info >= (2, 7, 15):
assert u.scheme == "google.com"
assert u.host is None
assert u.path == "80"
else:
assert u.scheme == ""
assert u.host is None
assert u.path == "google.com:80"
assert u.query_string == ""
assert u.fragment == ""

Expand Down

0 comments on commit aac3d93

Please sign in to comment.