File: fix_build_dir_in_tests.patch

package info (click to toggle)
python-hiredis 0.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 188 kB
  • ctags: 146
  • sloc: ansic: 389; python: 251; makefile: 5
file content (22 lines) | stat: -rw-r--r-- 711 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# our build directory is in .pybuild/ so this regexp will not find
# the right dir

Index: python-hiredis-0.2.0/test/__init__.py
===================================================================
--- python-hiredis-0.2.0.orig/test/__init__.py
+++ python-hiredis-0.2.0/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