mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 05:57:59 +01:00
scripted-diff: Use new python 3.7 keywords
-BEGIN VERIFY SCRIPT- sed -i 's/universal_newlines/text/g' $(git grep -l universal_newlines) -END VERIFY SCRIPT-
This commit is contained in:
@@ -146,7 +146,7 @@ def main():
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=None,
|
||||
stdin=subprocess.PIPE,
|
||||
universal_newlines=True)
|
||||
text=True)
|
||||
stdout, stderr = p.communicate()
|
||||
if p.returncode != 0:
|
||||
sys.exit(p.returncode)
|
||||
|
||||
@@ -23,7 +23,7 @@ help2man = os.getenv('HELP2MAN', 'help2man')
|
||||
# If not otherwise specified, get top directory from git.
|
||||
topdir = os.getenv('TOPDIR')
|
||||
if not topdir:
|
||||
r = subprocess.run([git, 'rev-parse', '--show-toplevel'], stdout=subprocess.PIPE, check=True, universal_newlines=True)
|
||||
r = subprocess.run([git, 'rev-parse', '--show-toplevel'], stdout=subprocess.PIPE, check=True, text=True)
|
||||
topdir = r.stdout.rstrip()
|
||||
|
||||
# Get input and output directories.
|
||||
@@ -36,7 +36,7 @@ versions = []
|
||||
for relpath in BINARIES:
|
||||
abspath = os.path.join(builddir, relpath)
|
||||
try:
|
||||
r = subprocess.run([abspath, "--version"], stdout=subprocess.PIPE, check=True, universal_newlines=True)
|
||||
r = subprocess.run([abspath, "--version"], stdout=subprocess.PIPE, check=True, text=True)
|
||||
except IOError:
|
||||
print(f'{abspath} not found or not an executable', file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
@@ -39,7 +39,7 @@ def call_security_check(cc, source, executable, options):
|
||||
env_flags += filter(None, os.environ.get(var, '').split(' '))
|
||||
|
||||
subprocess.run([*cc,source,'-o',executable] + env_flags + options, check=True)
|
||||
p = subprocess.run([os.path.join(os.path.dirname(__file__), 'security-check.py'), executable], stdout=subprocess.PIPE, universal_newlines=True)
|
||||
p = subprocess.run([os.path.join(os.path.dirname(__file__), 'security-check.py'), executable], stdout=subprocess.PIPE, text=True)
|
||||
return (p.returncode, p.stdout.rstrip())
|
||||
|
||||
def get_arch(cc, source, executable):
|
||||
|
||||
@@ -23,13 +23,13 @@ def call_symbol_check(cc: List[str], source, executable, options):
|
||||
env_flags += filter(None, os.environ.get(var, '').split(' '))
|
||||
|
||||
subprocess.run([*cc,source,'-o',executable] + env_flags + options, check=True)
|
||||
p = subprocess.run([os.path.join(os.path.dirname(__file__), 'symbol-check.py'), executable], stdout=subprocess.PIPE, universal_newlines=True)
|
||||
p = subprocess.run([os.path.join(os.path.dirname(__file__), 'symbol-check.py'), executable], stdout=subprocess.PIPE, text=True)
|
||||
os.remove(source)
|
||||
os.remove(executable)
|
||||
return (p.returncode, p.stdout.rstrip())
|
||||
|
||||
def get_machine(cc: List[str]):
|
||||
p = subprocess.run([*cc,'-dumpmachine'], stdout=subprocess.PIPE, universal_newlines=True)
|
||||
p = subprocess.run([*cc,'-dumpmachine'], stdout=subprocess.PIPE, text=True)
|
||||
return p.stdout.rstrip()
|
||||
|
||||
class TestSymbolChecks(unittest.TestCase):
|
||||
|
||||
Reference in New Issue
Block a user