[Pkg-gnupg-commit] [gpgme] 334/412: python: Do not rely on subprocess.DEVNULL.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Thu Sep 22 21:27:14 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository gpgme.

commit b48b852a846129914d6c63ec7b47388cdcf6acca
Author: Justus Winter <justus at g10code.com>
Date:   Mon Sep 12 16:18:31 2016 +0200

    python: Do not rely on subprocess.DEVNULL.
    
    * lang/python/setup.py.in: Do not rely on subprocess.DEVNULL.
    
    Signed-off-by: Justus Winter <justus at g10code.com>
---
 lang/python/setup.py.in | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lang/python/setup.py.in b/lang/python/setup.py.in
index a524c95..4477e09 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.")

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gpgme.git



More information about the Pkg-gnupg-commit mailing list