mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
gh-126554: correct detection of gcc
for TestNullDlsym.test_null_dlsym
(GH-129872)
In case gcc is not available, the test will fail with FileNotFoundError. So catch the exception to skip the test correctly. Signed-off-by: Peter Marko <peter.marko@siemens.com>
This commit is contained in:
parent
bff4bfeae1
commit
978211c8a8
1 changed files with 7 additions and 4 deletions
|
@ -58,11 +58,14 @@ class TestNullDlsym(unittest.TestCase):
|
|||
import subprocess
|
||||
import tempfile
|
||||
|
||||
retcode = subprocess.call(["gcc", "--version"],
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL)
|
||||
if retcode != 0:
|
||||
try:
|
||||
retcode = subprocess.call(["gcc", "--version"],
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL)
|
||||
except OSError:
|
||||
self.skipTest("gcc is missing")
|
||||
if retcode != 0:
|
||||
self.skipTest("gcc --version failed")
|
||||
|
||||
pipe_r, pipe_w = os.pipe()
|
||||
self.addCleanup(os.close, pipe_r)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue