pyupgrade --py37-plus

pull/9510/head
Eli Schwartz 3 years ago
parent ad525dcce4
commit 751f84405e
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 2
      mesonbuild/dependencies/hdf5.py
  2. 2
      run_meson_command_tests.py
  3. 3
      run_project_tests.py
  4. 2
      unittests/baseplatformtests.py
  5. 2
      unittests/linuxliketests.py
  6. 4
      unittests/rewritetests.py

@ -164,7 +164,7 @@ def hdf5_factory(env: 'Environment', for_machine: 'MachineChoice',
if PCEXE:
# some distros put hdf5-1.2.3.pc with version number in .pc filename.
ret = subprocess.run([PCEXE, '--list-all'], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL,
universal_newlines=True)
text=True)
if ret.returncode == 0:
for pkg in ret.stdout.split('\n'):
if pkg.startswith('hdf5'):

@ -70,7 +70,7 @@ class CommandTests(unittest.TestCase):
# between CI issue and test bug in that case. Set timeout and fail loud
# instead.
p = subprocess.run(command, stdout=subprocess.PIPE,
env=os.environ.copy(), universal_newlines=True,
env=os.environ.copy(), text=True,
cwd=workdir, timeout=60 * 5)
print(p.stdout)
if p.returncode != 0:

@ -926,8 +926,7 @@ def have_d_compiler() -> bool:
# that exists but segfaults every time the compiler is run.
# Don't know why. Don't know how to fix. Skip in this case.
cp = subprocess.run(['dmd', '--version'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
capture_output=True)
if cp.stdout == b'':
return False
return True

@ -160,7 +160,7 @@ class BasePlatformTests(TestCase):
p = subprocess.run(command, stdout=subprocess.PIPE,
stderr=subprocess.STDOUT, env=env,
encoding='utf-8',
universal_newlines=True, cwd=workdir, timeout=60 * 5)
text=True, cwd=workdir, timeout=60 * 5)
print(p.stdout)
if p.returncode != 0:
if 'MESON_SKIP_TEST' in p.stdout:

@ -1717,7 +1717,7 @@ class LinuxlikeTests(BasePlatformTests):
p = subprocess.run([ar, 't', outlib],
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL,
universal_newlines=True, timeout=1)
text=True, timeout=1)
obj_files = p.stdout.strip().split('\n')
self.assertEqual(len(obj_files), 1)
self.assertTrue(obj_files[0].endswith('-prelink.o'))

@ -32,8 +32,8 @@ class RewriterTests(BasePlatformTests):
if isinstance(args, str):
args = [args]
command = self.rewrite_command + ['--verbose', '--skip', '--sourcedir', directory] + args
p = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True, timeout=60)
p = subprocess.run(command, capture_output=True,
text=True, timeout=60)
print('STDOUT:')
print(p.stdout)
print('STDERR:')

Loading…
Cancel
Save