aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustus Winter <[email protected]>2016-09-12 14:18:31 +0000
committerJustus Winter <[email protected]>2016-09-12 14:18:31 +0000
commitb48b852a846129914d6c63ec7b47388cdcf6acca (patch)
treec1876d9d481cbf309915a669b7e69fa1d76f46e6
parenttests: Fix version comparison. (diff)
downloadgpgme-b48b852a846129914d6c63ec7b47388cdcf6acca.tar.gz
gpgme-b48b852a846129914d6c63ec7b47388cdcf6acca.zip
python: Do not rely on subprocess.DEVNULL.
* lang/python/setup.py.in: Do not rely on subprocess.DEVNULL. Signed-off-by: Justus Winter <[email protected]>
-rwxr-xr-xlang/python/setup.py.in9
1 files changed, 7 insertions, 2 deletions
diff --git a/lang/python/setup.py.in b/lang/python/setup.py.in
index a524c95c..4477e096 100755
--- a/lang/python/setup.py.in
+++ b/lang/python/setup.py.in
@@ -43,16 +43,21 @@ if os.path.exists("../../src/gpgme-config"):
IN_TREE_BUILD=1,
)
+if hasattr(subprocess, "DEVNULL"):
+ devnull = subprocess.DEVNULL
+else:
+ devnull = open(os.devnull, "w")
+
try:
subprocess.check_call([gpg_error_config, '--version'],
- stdout=subprocess.DEVNULL)
+ stdout=devnull)
except:
sys.exit("Could not find gpg-error-config. " +
"Please install the libgpg-error development package.")
try:
subprocess.check_call([gpgme_config, '--version'],
- stdout=subprocess.DEVNULL)
+ stdout=devnull)
except:
sys.exit("Could not find gpgme-config. " +
"Please install the libgpgme development package.")