Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit b47a0e8

Browse files
committed
Moved to py2/py3 branches for importing sentence from urllib
1 parent cd594bd commit b47a0e8

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

hyper/compat.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@
1515
# TODO log?
1616
ssl_compat = None
1717

18-
try:
19-
from urllib.parse import urlencode, urlsplit
20-
except ImportError: # pragma: no cover
21-
from urllib import urlencode
22-
from urlparse import urlsplit
23-
2418
_ver = sys.version_info
2519
is_py2 = _ver[0] == 2
2620
is_py2_7_9_or_later = _ver[0] >= 2 and _ver[1] >= 7 and _ver[2] >= 9
@@ -40,7 +34,8 @@ def ignore_missing():
4034
else:
4135
ssl = ssl_compat
4236

43-
from urlparse import urlparse
37+
from urllib import urlencode
38+
from urlparse import urlparse, urlsplit
4439

4540
def to_byte(char):
4641
return ord(char)
@@ -54,7 +49,7 @@ def zlib_compressobj(level=6, method=zlib.DEFLATED, wbits=15, memlevel=8,
5449
return zlib.compressobj(level, method, wbits, memlevel, strategy)
5550

5651
elif is_py3:
57-
from urllib.parse import urlparse
52+
from urllib.parse import urlencode, urlparse, urlsplit
5853

5954
def to_byte(char):
6055
return char

0 commit comments

Comments
 (0)