mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-03 17:54:19 +02:00
Merge #14903: tests: Handle ImportError explicitly, improve comparisons against None
c9ba253f4fAdd E711 to flake8 check (Daniel Ingram)17b55202daCompare to None with is/is not (Daniel Ingram)1b89074ae2Change '== None' to 'is None' (Daniel Ingram)16d2937723Handle exception as ImportError (Daniel Ingram) Pull request description: Tree-SHA512: aa5875ea3d9ac47ac898545ff023b511042cd377ea0c4594074daae119f3d4f3fc295721aad94a732a907086ecb32bce19a8eed38adf479f12663c4e8944f721
This commit is contained in:
@@ -109,7 +109,7 @@ def main():
|
||||
match = re.search('^\+\+\+\ (.*?/){%s}(\S*)' % args.p, line)
|
||||
if match:
|
||||
filename = match.group(2)
|
||||
if filename == None:
|
||||
if filename is None:
|
||||
continue
|
||||
|
||||
if args.regex is not None:
|
||||
|
||||
@@ -491,7 +491,7 @@ def get_git_change_year_range(filename):
|
||||
|
||||
def file_already_has_core_copyright(file_lines):
|
||||
index, _ = get_updatable_copyright_line(file_lines)
|
||||
return index != None
|
||||
return index is not None
|
||||
|
||||
################################################################################
|
||||
# insert header execution
|
||||
|
||||
@@ -25,7 +25,7 @@ import json
|
||||
import codecs
|
||||
try:
|
||||
from urllib.request import Request,urlopen
|
||||
except:
|
||||
except ImportError:
|
||||
from urllib2 import Request,urlopen
|
||||
|
||||
# External tools (can be overridden using environment)
|
||||
|
||||
@@ -125,7 +125,7 @@ def escape_cdata(text):
|
||||
return text
|
||||
|
||||
def contains_bitcoin_addr(text, errors):
|
||||
if text != None and ADDRESS_REGEXP.search(text) != None:
|
||||
if text is not None and ADDRESS_REGEXP.search(text) is not None:
|
||||
errors.append('Translation "%s" contains a bitcoin address. This will be removed.' % (text))
|
||||
return True
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user