https://github.com/python/cpython/commit/cef406bbc3a35d487763e1a4ea075f1fcfa5497d commit: cef406bbc3a35d487763e1a4ea075f1fcfa5497d branch: 3.13 author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com> committer: picnixz <10796600+picn...@users.noreply.github.com> date: 2025-02-10T10:16:28Z summary:
[3.13] gh-126554: correct detection of `gcc` for `TestNullDlsym.test_null_dlsym` (GH-129872) (#129944) 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. (cherry picked from commit 978211c8a8646b050a8d687ca720f934fcce112c) Signed-off-by: Peter Marko <peter.ma...@siemens.com> Co-authored-by: Peter Marko <peter.ma...@siemens.com> files: M Lib/test/test_ctypes/test_dlerror.py diff --git a/Lib/test/test_ctypes/test_dlerror.py b/Lib/test/test_ctypes/test_dlerror.py index 6bf492399cbf95..1c1b2aab3d589e 100644 --- a/Lib/test/test_ctypes/test_dlerror.py +++ b/Lib/test/test_ctypes/test_dlerror.py @@ -58,11 +58,14 @@ def test_null_dlsym(self): 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) _______________________________________________ Python-checkins mailing list -- python-checkins@python.org To unsubscribe send an email to python-checkins-le...@python.org https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: arch...@mail-archive.com