[Piglit] [PATCH] Change placment of the orientation of sys.path
Dylan Baker
baker.dylan.c at gmail.com
Tue Jan 6 13:14:30 PST 2015
Reviewed-by: Dylan Baker <dylanx.c.baker at intel.com>
On Tuesday, January 06, 2015 09:05:03 PM Matěj Cepl wrote:
> 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)
> return
>
> print('error: failed to find piglit data directory. exiting...', file=sys.stderr)
> --
> 1.8.3.1
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20150106/623c8cd2/attachment.sig>
More information about the Piglit
mailing list