From 83db31c4b4dbf1a62242c01015b19d9d280418c7 Mon Sep 17 00:00:00 2001
From: Ian Lynagh <igloo@earth.li>
Date: Tue, 22 May 2012 17:41:34 +0100
Subject: [PATCH] Fix a testsuite driver failure on cygwin

---
 driver/runtests.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/driver/runtests.py b/driver/runtests.py
index ec1c04607..d06bc8ea8 100644
--- a/driver/runtests.py
+++ b/driver/runtests.py
@@ -10,6 +10,17 @@ import platform
 import time
 import re
 
+# We don't actually need subprocess in runtests.py, but:
+# * We do need it in testlibs.py
+# * We can't import testlibs.py until after we have imported ctypes
+# * If we import ctypes before subprocess on cygwin, then sys.exit(0)
+#   says "Aborted" and we fail with exit code 134.
+# So we import it here first, so that the testsuite doesn't appear to fail.
+try:
+    import subprocess
+except:
+    pass
+
 from testutil import *
 from testglobals import *
 
-- 
GitLab