From: Pierce Lopez Date: Mon, 1 Jan 2018 19:22:58 +0000 (-0500) Subject: fix "unused variable" flake warnings X-Git-Tag: v5.0.0~20^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27bb4eab8db21bb59d7629b7ccdba6134b6110b7;p=thirdparty%2Ftornado.git fix "unused variable" flake warnings in iostream_test, and an exception var in tornado.routing that only python2 pyflakes caught --- diff --git a/tornado/routing.py b/tornado/routing.py index f2302a8a5..d3f17803b 100644 --- a/tornado/routing.py +++ b/tornado/routing.py @@ -582,7 +582,7 @@ class PathMatches(Matcher): else: try: unescaped_fragment = re_unescape(fragment) - except ValueError as exc: + except ValueError: # If we can't unescape part of it, we can't # reverse this url. return (None, None) diff --git a/tornado/test/iostream_test.py b/tornado/test/iostream_test.py index f7c80451a..8aef35208 100644 --- a/tornado/test/iostream_test.py +++ b/tornado/test/iostream_test.py @@ -1173,7 +1173,6 @@ class TestStreamBuffer(unittest.TestCase): def check_append_all_then_skip_all(self, buf, objs, input_type): self.assertEqual(len(buf), 0) - total_expected = b''.join(objs) expected = b'' for o in objs: @@ -1182,8 +1181,6 @@ class TestStreamBuffer(unittest.TestCase): self.assertEqual(len(buf), len(expected)) self.check_peek(buf, expected) - total_size = len(expected) - while expected: n = self.random.randrange(1, len(expected) + 1) expected = expected[n:]