Skip to content

Commit 248ca46

Browse files
committed
flake8 fixes to common.py
1 parent 3ab8d24 commit 248ca46

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

test/common.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,10 +1950,10 @@ def send_head(self):
19501950
self.send_header('Content-Type', ctype)
19511951
pieces = self.headers.get("Range").split("=")[1].split("-")
19521952
start = int(pieces[0]) if pieces[0] != '' else 0
1953-
end = int(pieces[1]) if pieces[1] != '' else fs[6]-1
1953+
end = int(pieces[1]) if pieces[1] != '' else fs[6] - 1
19541954
end = min(fs[6] - 1, end)
19551955
length = end - start + 1
1956-
self.send_header('Content-Range', "bytes "+str(start)+"-"+str(end)+"/"+str(fs[6]));
1956+
self.send_header('Content-Range', "bytes " + str(start) + "-" + str(end) + "/" + str(fs[6]))
19571957
self.send_header('Content-Length', str(length))
19581958
self.end_headers()
19591959
return f
@@ -2062,20 +2062,19 @@ def do_GET(self):
20622062
path = self.translate_path(self.path)
20632063
data = read_binary(path)
20642064
ctype = self.guess_type(path)
2065-
self.send_header('Content-type', 'text/html')
2065+
self.send_header('Content-type', ctype)
20662066
pieces = self.headers.get("range").split("=")[1].split("-")
20672067
start = int(pieces[0]) if pieces[0] != '' else 0
2068-
end = int(pieces[1]) if pieces[1] != '' else len(data)-1
2068+
end = int(pieces[1]) if pieces[1] != '' else len(data) - 1
20692069
end = min(len(data) - 1, end)
20702070
length = end - start + 1
20712071
self.send_header('Content-Length', str(length))
2072-
self.send_header('Content-Range', "bytes "+str(start)+"-"+str(end)+"/"+str(len(data)));
2072+
self.send_header('Content-Range', "bytes " + str(start) + "-" + str(end) + "/" + str(len(data)))
20732073
self.end_headers()
20742074
self.wfile.write(data[start:end + 1])
20752075
else:
20762076
SimpleHTTPRequestHandler.do_GET(self)
20772077

2078-
20792078
def log_request(code=0, size=0):
20802079
# don't log; too noisy
20812080
pass

0 commit comments

Comments
 (0)