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

Commit 46a31a2

Browse files
committed
Fixup linting errors in cli.py
1 parent dd7b69b commit 46a31a2

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

hyper/cli.py

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -111,23 +111,25 @@ def make_troubleshooting_argument(parser):
111111
help="Do HTTP/2 directly in plaintext: skip plaintext upgrade")
112112

113113

114-
def set_url_info(args):
115-
def split_host_and_port(hostname):
116-
if ':' in hostname:
117-
return to_host_port_tuple(hostname, default_port=443)
118-
return hostname, None
119-
120-
class UrlInfo(object):
121-
def __init__(self):
122-
self.fragment = None
123-
self.host = 'localhost'
124-
self.netloc = None
125-
self.path = '/'
126-
self.port = 443
127-
self.query = None
128-
self.scheme = 'https'
129-
self.secure = False
114+
def split_host_and_port(hostname):
115+
if ':' in hostname:
116+
return to_host_port_tuple(hostname, default_port=443)
117+
return hostname, None
118+
119+
120+
class UrlInfo(object):
121+
def __init__(self):
122+
self.fragment = None
123+
self.host = 'localhost'
124+
self.netloc = None
125+
self.path = '/'
126+
self.port = 443
127+
self.query = None
128+
self.scheme = 'https'
129+
self.secure = False
130130

131+
132+
def set_url_info(args):
131133
info = UrlInfo()
132134
_result = urlsplit(args._url)
133135
for attr in vars(info).keys():
@@ -167,9 +169,9 @@ def set_request_data(args):
167169
if i.key:
168170
headers[i.key] = i.value
169171
else:
170-
# when overriding a HTTP/2 special header there will be a leading
171-
# colon, which tricks the command line parser into thinking
172-
# the header is empty
172+
# when overriding a HTTP/2 special header there will be a
173+
# leading colon, which tricks the command line parser into
174+
# thinking the header is empty
173175
k, v = i.value.split(':', 1)
174176
headers[':' + k] = v
175177
elif i.sep == SEP_QUERY:

0 commit comments

Comments
 (0)