From f206f11743d56e4a64f15b600c8703d028055b69 Mon Sep 17 00:00:00 2001
From: Manuel Guenther <manuel.guenther@idiap.ch>
Date: Mon, 23 Feb 2015 20:01:05 +0100
Subject: [PATCH] Corrected search order of get_include_directories to match
 the one in setup.py

---
 bob/io/base/__init__.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/bob/io/base/__init__.py b/bob/io/base/__init__.py
index 1ad32e9..2e5a160 100644
--- a/bob/io/base/__init__.py
+++ b/bob/io/base/__init__.py
@@ -219,10 +219,7 @@ def get_include_directories():
   """Returns a list of include directories for dependent libraries, such as HDF5."""
   from bob.extension import pkgconfig
   # try to use pkg_config first
-  try: 
-    pkg = pkgconfig('hdf5')
-    return pkg.include_directories()
-  except RuntimeError:
+  try:
     from bob.extension.utils import find_header
     # locate pkg-config on our own
     header = 'hdf5.h'
@@ -231,8 +228,11 @@ def get_include_directories():
       raise RuntimeError("could not find %s's `%s' - have you installed %s on this machine?" % ('hdf5', header, 'hdf5'))
 
     return [os.path.dirname(candidates[0])]
+  except RuntimeError:
+    pkg = pkgconfig('hdf5')
+    return pkg.include_directories()
+
 
-  
 
 # gets sphinx autodoc done right - don't remove it
 __all__ = [_ for _ in dir() if not _.startswith('_')]
-- 
GitLab