commit 426962e4ce8faa663db449216122940d28743c46
Author: Sam Thursfield <sam@afuera.me.uk>
Date:   Fri Apr 14 13:02:35 2017 +0100

    Fix 'Bad file descriptor' error when checking libtool version
    
    Running g-ir-scanner on Fedora 25 (libtool 2.4.6) produces the following
    message on stderr, twice:
    
        /usr/bin/libtool: line 2460: printf: write error: Bad file descriptor
    
    The error is harmless as we are just checking if libtool is present, but
    it is misleading for g-ir-scanner to show such an error.
    
    Giving libtool a valid stdout fixes the issue. We could instead redirect
    stderr to /dev/null but this risks hiding a useful error message.

diff --git a/giscanner/utils.py b/giscanner/utils.py
index aff5393..5291fda 100644
--- a/giscanner/utils.py
+++ b/giscanner/utils.py
@@ -159,7 +159,7 @@ def get_libtool_command(options):
         libtool_cmd = 'glibtool'
     try:
         subprocess.check_call([libtool_cmd, '--version'],
-                              stdout=open(os.devnull))
+                              stdout=subprocess.PIPE)
     except (subprocess.CalledProcessError, OSError):
         # If libtool's not installed, assume we don't need it
         return None
