]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Skip the test requiring ctypes if ctypes is unavailable.
authorGregory P. Smith <greg@krypto.org>
Mon, 23 Jan 2017 06:19:38 +0000 (22:19 -0800)
committerGregory P. Smith <greg@krypto.org>
Mon, 23 Jan 2017 06:19:38 +0000 (22:19 -0800)
prevents http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.x/builds/240/steps/test/logs/stdio

Lib/test/test_subprocess.py

index 65b7cce131975af794ffa5a798018ed92eae7bd4..2dc03ee7001bf383d1d1e23c8d646c427da78c45 100644 (file)
@@ -5,7 +5,6 @@ from test import support
 import subprocess
 import sys
 import platform
-import ctypes
 import signal
 import io
 import locale
@@ -22,6 +21,11 @@ import shutil
 import gc
 import textwrap
 
+try:
+    import ctypes
+except ImportError:
+    ctypes = None
+
 try:
     import threading
 except ImportError:
@@ -2454,6 +2458,7 @@ class POSIXProcessTestCase(BaseTestCase):
       'Linux': 'so.6',
       'Darwin': 'dylib',
     }
+    @unittest.skipIf(not ctypes, 'ctypes module required.')
     @unittest.skipIf(platform.uname()[0] not in _libc_file_extensions,
                      'Test requires a libc this code can load with ctypes.')
     @unittest.skipIf(not sys.executable, 'Test requires sys.executable.')