Skip to content

Commit 751f844

Browse files
committed
pyupgrade --py37-plus
1 parent ad525dc commit 751f844

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed

mesonbuild/dependencies/hdf5.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def hdf5_factory(env: 'Environment', for_machine: 'MachineChoice',
164164
if PCEXE:
165165
# some distros put hdf5-1.2.3.pc with version number in .pc filename.
166166
ret = subprocess.run([PCEXE, '--list-all'], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL,
167-
universal_newlines=True)
167+
text=True)
168168
if ret.returncode == 0:
169169
for pkg in ret.stdout.split('\n'):
170170
if pkg.startswith('hdf5'):

run_meson_command_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def _run(self, command, workdir=None):
7070
# between CI issue and test bug in that case. Set timeout and fail loud
7171
# instead.
7272
p = subprocess.run(command, stdout=subprocess.PIPE,
73-
env=os.environ.copy(), universal_newlines=True,
73+
env=os.environ.copy(), text=True,
7474
cwd=workdir, timeout=60 * 5)
7575
print(p.stdout)
7676
if p.returncode != 0:

run_project_tests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,8 +926,7 @@ def have_d_compiler() -> bool:
926926
# that exists but segfaults every time the compiler is run.
927927
# Don't know why. Don't know how to fix. Skip in this case.
928928
cp = subprocess.run(['dmd', '--version'],
929-
stdout=subprocess.PIPE,
930-
stderr=subprocess.PIPE)
929+
capture_output=True)
931930
if cp.stdout == b'':
932931
return False
933932
return True

unittests/baseplatformtests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def _run(self, command, *, workdir=None, override_envvars: T.Optional[T.Mapping[
160160
p = subprocess.run(command, stdout=subprocess.PIPE,
161161
stderr=subprocess.STDOUT, env=env,
162162
encoding='utf-8',
163-
universal_newlines=True, cwd=workdir, timeout=60 * 5)
163+
text=True, cwd=workdir, timeout=60 * 5)
164164
print(p.stdout)
165165
if p.returncode != 0:
166166
if 'MESON_SKIP_TEST' in p.stdout:

unittests/linuxliketests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1717,7 +1717,7 @@ def test_prelinking(self):
17171717
p = subprocess.run([ar, 't', outlib],
17181718
stdout=subprocess.PIPE,
17191719
stderr=subprocess.DEVNULL,
1720-
universal_newlines=True, timeout=1)
1720+
text=True, timeout=1)
17211721
obj_files = p.stdout.strip().split('\n')
17221722
self.assertEqual(len(obj_files), 1)
17231723
self.assertTrue(obj_files[0].endswith('-prelink.o'))

unittests/rewritetests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def rewrite_raw(self, directory, args):
3232
if isinstance(args, str):
3333
args = [args]
3434
command = self.rewrite_command + ['--verbose', '--skip', '--sourcedir', directory] + args
35-
p = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
36-
universal_newlines=True, timeout=60)
35+
p = subprocess.run(command, capture_output=True,
36+
text=True, timeout=60)
3737
print('STDOUT:')
3838
print(p.stdout)
3939
print('STDERR:')

0 commit comments

Comments
 (0)