Navigation Menu

Skip to content

Commit

Permalink
lint: Un-skip a few rules
Browse files Browse the repository at this point in the history
  • Loading branch information
bdarnell committed Jan 6, 2018
1 parent f7a7026 commit 3d9ae0e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
4 changes: 0 additions & 4 deletions .flake8
Expand Up @@ -2,8 +2,6 @@
exclude = .git,.tox,__pycache__,.eggs,build
max-line-length = 100
ignore =
# E231 missing whitespace after ','
E231,
# E265 block comment should start with '# '
E265,
# E266 too many leading '#' for block comment
Expand All @@ -12,5 +10,3 @@ ignore =
E402,
# E722 do not use bare except
E722,
# E741 ambiguous variable name 'l'
E741,
3 changes: 2 additions & 1 deletion demos/benchmark/template_benchmark.py
Expand Up @@ -14,7 +14,8 @@

context = {
'page_title': 'mitsuhiko\'s benchmark',
'table': [dict(a=1,b=2,c=3,d=4,e=5,f=6,g=7,h=8,i=9,j=10) for x in range(1000)]
'table': [dict(a=1, b=2, c=3, d=4, e=5,
f=6, g=7, h=8, i=9, j=10) for x in range(1000)]
}

tmpl = Template("""\
Expand Down
2 changes: 1 addition & 1 deletion maint/test/appengine/common/runtests.py
Expand Up @@ -51,7 +51,7 @@
for sig in [signal.SIGTERM, signal.SIGTERM, signal.SIGKILL]:
os.kill(proc.pid, sig)
res = os.waitpid(proc.pid, os.WNOHANG)
if res != (0,0):
if res != (0, 0):
break
time.sleep(0.1)
else:
Expand Down
2 changes: 1 addition & 1 deletion tornado/test/gen_test.py
Expand Up @@ -1021,7 +1021,7 @@ def inner(iteration):
self.finished = True

@skipNotCPython
@unittest.skipIf((3,) < sys.version_info < (3,6),
@unittest.skipIf((3,) < sys.version_info < (3, 6),
"asyncio.Future has reference cycles")
def test_coroutine_refcounting(self):
# On CPython, tasks and their arguments should be released immediately
Expand Down
12 changes: 6 additions & 6 deletions tornado/websocket.py
Expand Up @@ -757,17 +757,17 @@ def _write_frame(self, fin, opcode, data, flags=0):
else:
finbit = 0
frame = struct.pack("B", finbit | opcode | flags)
l = len(data)
data_len = len(data)
if self.mask_outgoing:
mask_bit = 0x80
else:
mask_bit = 0
if l < 126:
frame += struct.pack("B", l | mask_bit)
elif l <= 0xFFFF:
frame += struct.pack("!BH", 126 | mask_bit, l)
if data_len < 126:
frame += struct.pack("B", data_len | mask_bit)
elif data_len <= 0xFFFF:
frame += struct.pack("!BH", 126 | mask_bit, data_len)
else:
frame += struct.pack("!BQ", 127 | mask_bit, l)
frame += struct.pack("!BQ", 127 | mask_bit, data_len)
if self.mask_outgoing:
mask = os.urandom(4)
data = mask + _websocket_mask(mask, data)
Expand Down

0 comments on commit 3d9ae0e

Please sign in to comment.