[Mesa-dev] [PATCH] Fix mapi code generator for out-of-tree build

Kenneth Graunke kenneth at whitecape.org
Tue Jan 15 08:10:30 PST 2013


On 01/15/2013 02:41 AM, Jon TURNEY wrote:
> Use os.path.join() rather than hand-rolling it, so path is correct if
> sys.argv[0] returns an absolute path.
>
> (According to the python documentation, it's platform dependent whether
> sys.argv[0] is a full pathname or not.  It probably also depends on how
> the process was started...)
>
> Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
> ---
>   src/mapi/mapi/mapi_abi.py |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/mapi/mapi/mapi_abi.py b/src/mapi/mapi/mapi_abi.py
> index 30ffe7b..c645c02 100644
> --- a/src/mapi/mapi/mapi_abi.py
> +++ b/src/mapi/mapi/mapi_abi.py
> @@ -29,7 +29,7 @@
>   import sys
>   # make it possible to import glapi
>   import os
> -GLAPI = "./%s/../glapi/gen" % (os.path.dirname(sys.argv[0]))
> +GLAPI = os.path.join(".", os.path.dirname(sys.argv[0]), "../glapi/gen")
>   sys.path.append(GLAPI)
>
>   import re

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>



More information about the mesa-dev mailing list