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

Commit f3505e1

Browse files
committed
Fix syntax errors and import issues
1 parent e6031a9 commit f3505e1

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

hyper/cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from hyper import HTTPConnection, HTTP20Connection
1818
from hyper import __version__
1919
from hyper.compat import is_py2, urlencode, urlsplit, write_to_stdout
20+
from hyper.common.util import to_host_port_tuple
2021

2122

2223
log = logging.getLogger('hyper')

hyper/common/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def to_bytestring_tuple(*x):
2626
"""
2727
return tuple(imap(to_bytestring, x))
2828

29-
def to_host_port_tuple(host_port_str, default_port=80)
29+
def to_host_port_tuple(host_port_str, default_port=80):
3030
"""
3131
Converts the given string containing a host and possibly a port
3232
to a tuple.
@@ -40,4 +40,4 @@ def to_host_port_tuple(host_port_str, default_port=80)
4040

4141
host = host.strip('[]')
4242

43-
return tuple(host, port)
43+
return ((host, port))

hyper/http11/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from ..common.bufsocket import BufferedSocket
1616
from ..common.exceptions import TLSUpgrade, HTTPUpgrade
1717
from ..common.headers import HTTPHeaderMap
18-
from ..common.util import to_bytestring
18+
from ..common.util import to_bytestring, to_host_port_tuple
1919
from ..compat import bytes
2020

2121
from ..packages.hyperframe.frame import SettingsFrame

hyper/http20/connection.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from ..common.exceptions import ConnectionResetError
1010
from ..common.bufsocket import BufferedSocket
1111
from ..common.headers import HTTPHeaderMap
12+
from ..common.util import to_host_port_tuple
1213
from ..packages.hyperframe.frame import (
1314
FRAMES, DataFrame, HeadersFrame, PushPromiseFrame, RstStreamFrame,
1415
SettingsFrame, Frame, WindowUpdateFrame, GoAwayFrame, PingFrame,

0 commit comments

Comments
 (0)