Commit 2cbb7e2a authored by Nicolas Ouellet-Payeur's avatar Nicolas Ouellet-Payeur Committed by Commit Bot

Revert "Traffic annotation auditor: fix Python 3 compat"

This reverts commit a1b98ca7.

Reason for revert: https://crbug.com/1054895#c27

Original change's description:
> Traffic annotation auditor: fix Python 3 compat
> 
> filter() results are not subscriptable in Python 3, so we need to use
> next() to retrieve the first element instead.
> 
> Bug: 1056747, 941669
> Change-Id: I003eda9a8044d18bf7a2aae82086693aa0386c90
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2079191
> Reviewed-by: Martin Šrámek <msramek@chromium.org>
> Commit-Queue: Domenic Denicola <domenic@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#745163}

TBR=msramek@chromium.org,domenic@chromium.org

Change-Id: I973a3fb59a7a678031a0bbfe239657d300512c87
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1056747, 941669
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2079256Reviewed-by: default avatarNicolas Ouellet-Payeur <nicolaso@chromium.org>
Commit-Queue: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745192}
parent 99e40517
...@@ -84,7 +84,7 @@ class Tokenizer: ...@@ -84,7 +84,7 @@ class Tokenizer:
for (token_type, regex) in TOKEN_REGEXEN: for (token_type, regex) in TOKEN_REGEXEN:
re_match = regex.match(self.body, pos) re_match = regex.match(self.body, pos)
if re_match: if re_match:
token_content = next(filter(lambda x: x is not None, re_match.groups())) token_content = filter(lambda x: x is not None, re_match.groups())[0]
token = Token(token_type, token_content, re_match.end()) token = Token(token_type, token_content, re_match.end())
break break
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment