From 8a7a06f4e25b9c7288d5e66f6f30962e2a4e377f Mon Sep 17 00:00:00 2001 From: fanquake Date: Tue, 17 Nov 2020 13:57:23 +0800 Subject: [PATCH] Merge #20346: script: modify security-check.py to use "==" instead of "is" for literal comparison b6121edf70a8d50fd16ddbba0c3168e5e49bfc2e swapped "is" for "==" in literal comparison (Tyler Chambers) Pull request description: In Python 3.8+ literal comparisons using "is" instead of "==" produce a SyntaxWarning [source](https://docs.python.org/3.8/whatsnew/3.8.html#changes-in-python-behavior). I checked the entire devtools directory, this seems to be the only occurrence. This is a small fix, but removes the SyntaxWarning. Fixes: #20338 ACKs for top commit: hebasto: re-ACK b6121edf70a8d50fd16ddbba0c3168e5e49bfc2e, only squashed since my [previous](https://github.com/bitcoin/bitcoin/pull/20346#pullrequestreview-525934568) review. practicalswift: re-ACK b6121edf70a8d50fd16ddbba0c3168e5e49bfc2e: patch still looks correct theStack: utACK b6121edf70a8d50fd16ddbba0c3168e5e49bfc2e Tree-SHA512: 82a43495d6552fbaa3b02b58f0930b049d27aa937fe44b47714e3c059f844cc494de20674557371cbccf24fb8873ecb7376fb965ae326847eed2b855ed2d59c6 --- test/lint/lint-python.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/test/lint/lint-python.sh b/test/lint/lint-python.sh index c85d9905c4b2a..5f252c75c8c27 100755 --- a/test/lint/lint-python.sh +++ b/test/lint/lint-python.sh @@ -54,6 +54,7 @@ enabled=( F621 # too many expressions in an assignment with star-unpacking F622 # two or more starred expressions in an assignment (a, *b, *c = d) F631 # assertion test is a tuple, which are always True + F632 # use ==/!= to compare str, bytes, and int literals F701 # a break statement outside of a while or for loop F702 # a continue statement outside of a while or for loop F703 # a continue statement in a finally block in a loop