[Piglit] [PATCH] Change placment of the orientation of sys.path

Matěj Cepl mcepl at redhat.com
Tue Jan 6 12:05:03 PST 2015

From: Matěj Cepl <mcepl at cepl.eu>

The modification should to the beginning of sys.path not to the end,
because otherwise it hits every package which has tests submodule (which
seems to be like all of them ;)).

The first change is just to make abs_libdir more pretty.

Signed-off-by: Matěj Cepl <mcepl at redhat.com>
 piglit | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/piglit b/piglit
index 7c84ded..53a4bb4 100755
--- a/piglit
+++ b/piglit
@@ -91,10 +91,10 @@ def setup_module_search_path():
     abs_bindir = abs_script_dir
     script_basename_noext = os.path.splitext(os.path.basename(__file__))[0]
     for libdir in ('lib64', 'lib32', 'lib'):
-        abs_libdir = path.join(abs_bindir, '..', libdir)
+        abs_libdir = path.normpath(path.join(abs_bindir, '..', libdir))
         abs_data_dir = path.join(abs_libdir, script_basename_noext)
         if is_piglit_data_dir(abs_data_dir):
-            sys.path.append(abs_data_dir)
+            sys.path.insert(0, abs_data_dir)
     print('error: failed to find piglit data directory. exiting...', file=sys.stderr)

More information about the Piglit mailing list