Skip to content

Commit 55d78e8

Browse files
fanquakePastaPastaPasta
authored andcommitted
Merge bitcoin#20346: script: modify security-check.py to use "==" instead of "is" for literal comparison
b6121ed 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: bitcoin#20338 ACKs for top commit: hebasto: re-ACK b6121ed, only squashed since my [previous](bitcoin#20346 (review)) review. practicalswift: re-ACK b6121ed: patch still looks correct theStack: utACK b6121ed Tree-SHA512: 82a43495d6552fbaa3b02b58f0930b049d27aa937fe44b47714e3c059f844cc494de20674557371cbccf24fb8873ecb7376fb965ae326847eed2b855ed2d59c6
1 parent 822a818 commit 55d78e8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/lint/lint-python.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ enabled=(
5555
F621 # too many expressions in an assignment with star-unpacking
5656
F622 # two or more starred expressions in an assignment (a, *b, *c = d)
5757
F631 # assertion test is a tuple, which are always True
58+
F632 # use ==/!= to compare str, bytes, and int literals
5859
F701 # a break statement outside of a while or for loop
5960
F702 # a continue statement outside of a while or for loop
6061
F703 # a continue statement in a finally block in a loop

0 commit comments

Comments
 (0)