diff options
-rw-r--r-- | mesonbuild/dependencies/hdf5.py | 2 | ||||
-rwxr-xr-x | run_meson_command_tests.py | 2 | ||||
-rwxr-xr-x | run_project_tests.py | 3 | ||||
-rw-r--r-- | unittests/baseplatformtests.py | 2 | ||||
-rw-r--r-- | unittests/linuxliketests.py | 2 | ||||
-rw-r--r-- | unittests/rewritetests.py | 4 |
6 files changed, 7 insertions, 8 deletions
diff --git a/mesonbuild/dependencies/hdf5.py b/mesonbuild/dependencies/hdf5.py index 78ef9d6..2f1ed0a 100644 --- a/mesonbuild/dependencies/hdf5.py +++ b/mesonbuild/dependencies/hdf5.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'): diff --git a/run_meson_command_tests.py b/run_meson_command_tests.py index 45096c6..36cb02e 100755 --- a/run_meson_command_tests.py +++ b/run_meson_command_tests.py @@ -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: diff --git a/run_project_tests.py b/run_project_tests.py index 822cf0b..5fea660 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -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 diff --git a/unittests/baseplatformtests.py b/unittests/baseplatformtests.py index bd2f902..2f8064e 100644 --- a/unittests/baseplatformtests.py +++ b/unittests/baseplatformtests.py @@ -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: diff --git a/unittests/linuxliketests.py b/unittests/linuxliketests.py index 594e9f0..ade489d 100644 --- a/unittests/linuxliketests.py +++ b/unittests/linuxliketests.py @@ -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')) diff --git a/unittests/rewritetests.py b/unittests/rewritetests.py index 1e6a398..1d90f2a 100644 --- a/unittests/rewritetests.py +++ b/unittests/rewritetests.py @@ -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:') |