File: tests_inject_correct_build_dir.patch

package info (click to toggle)
python-dmidecode 3.12.2-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 908 kB
  • ctags: 549
  • sloc: ansic: 6,925; xml: 741; python: 598; makefile: 89; sh: 68
file content (17 lines) | stat: -rw-r--r-- 563 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--- a/unit-tests/unit
+++ b/unit-tests/unit
@@ -8,9 +8,11 @@ if sys.version_info[0] < 3:
 from getopt import getopt
 
 # Setup temporary sys.path() with our build dir
-(sysname, nodename, release, version, machine) = os.uname()
-pyver = sys.version[:3]
-sys.path.insert(0,'../build/lib.%s-%s-%s' % (sysname.lower(), machine, pyver))
+from distutils.command.build import build
+from distutils.core import Distribution
+b = build(Distribution())
+b.finalize_options()
+sys.path.insert(0, '../'+b.build_platlib)
 
 root_user = (os.getuid() == 0 and True or False)