File fix_build_dir_in_tests.patch of Package python-hiredis

From b47cba0a1ee062273569c076f96562770e641131 Mon Sep 17 00:00:00 2001
From: SVN-Git Migration <python-modules-team@lists.alioth.debian.org>
Date: Thu, 8 Oct 2015 12:13:26 -0700
Subject: fix_build_dir_in_tests

Patch-Name: fix_build_dir_in_tests.patch
---
 test/__init__.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/test/__init__.py b/test/__init__.py
index 08a10a4..87bc6a9 100644
--- a/test/__init__.py
+++ b/test/__init__.py
@@ -1,11 +1,12 @@
 import glob, os.path, sys
+from os import environ
 
 version = sys.version.split(" ")[0]
 majorminor = version[0:3]
 
 # Add path to hiredis.so load path
-path = glob.glob("build/lib*-%s/hiredis" % majorminor)[0]
-sys.path.insert(0, path)
+path = glob.glob("build/lib*-%s/hiredis" % majorminor)
+sys.path.insert(0, environ.get('BUILDDIR', path and path[0]))
 
 from unittest import *
 from . import reader
openSUSE Build Service is sponsored by