From 9b19e19ab79eada8c415793a2c4e83a918c04d25 Mon Sep 17 00:00:00 2001 From: mattip Date: Fri, 16 Jun 2023 12:45:42 +0300 Subject: [PATCH] TEST: change subprocess call to capture stderr too --- numpy/testing/_private/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/numpy/testing/_private/utils.py b/numpy/testing/_private/utils.py index cca7b80635fd..6ef1fbe7da04 100644 --- a/numpy/testing/_private/utils.py +++ b/numpy/testing/_private/utils.py @@ -1248,8 +1248,8 @@ def check_support_sve(): import subprocess cmd = 'lscpu' try: - return "sve" in (subprocess.Popen(cmd, stdout=subprocess.PIPE, - shell=True).communicate()[0]).decode('utf-8') + output = subprocess.run(cmd, capture_output=True, text=True) + return 'sve' in output.stdout except OSError: return False