python: Fix errors from pycodestyle 2.6.0.

zerver/lib/i18n.py:34:28: E741 ambiguous variable name 'l'
zerver/lib/webhooks/common.py:103:34: E225 missing whitespace around operator
zerver/tests/test_queue_worker.py:563:9: E306 expected 1 blank line before a nested definition, found 0

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2020-06-02 21:02:53 -07:00 committed by Tim Abbott
parent 9a9c1e0794
commit 10805abd6e
3 changed files with 5 additions and 4 deletions

View File

@ -31,9 +31,9 @@ def get_language_list() -> List[Dict[str, Any]]:
return languages['name_map']
def get_language_list_for_templates(default_language: str) -> List[Dict[str, Dict[str, str]]]:
language_list = [l for l in get_language_list()
if 'percent_translated' not in l or
l['percent_translated'] >= 5.]
language_list = [lang for lang in get_language_list()
if 'percent_translated' not in lang or
lang['percent_translated'] >= 5.]
formatted_list = []
lang_len = len(language_list)

View File

@ -100,7 +100,7 @@ def standardize_headers(input_headers: Union[None, Dict[str, Any]]) -> Dict[str,
for raw_header in input_headers:
polished_header = raw_header.upper().replace("-", "_")
if polished_header not in["CONTENT_TYPE", "CONTENT_LENGTH"]:
if polished_header not in ["CONTENT_TYPE", "CONTENT_LENGTH"]:
if not polished_header.startswith("HTTP_"):
polished_header = "HTTP_" + polished_header
canonical_headers[polished_header] = str(input_headers[raw_header])

View File

@ -560,6 +560,7 @@ class WorkerTest(ZulipTestCase):
self.assertEqual(event["type"], 'unexpected behaviour')
processed = []
@queue_processors.assign_queue('unreliable_loopworker')
class UnreliableLoopWorker(queue_processors.LoopQueueProcessingWorker):
def consume_batch(self, events: List[Dict[str, Any]]) -> None: