summaryrefslogtreecommitdiffstats
path: root/src/mapi/mapi_abi.py
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2018-12-09 20:09:49 +0000
committerEmil Velikov <[email protected]>2019-01-24 18:13:24 +0000
commitca152234e1903f0ad41e6b27c6a0626025e3f80c (patch)
treeaa234d28f54aece5416b012a8c17cdf0376b81e9 /src/mapi/mapi_abi.py
parent9cc8e125053ec429be6b4640e784a5e3fce57298 (diff)
mesa: correctly use os.path.join in our python scripts
With Windows in mind, using forward slash isn't the right thing to do. Even if it just works, we might want to fix it. As here, use __file__ instead of argv[0] and sys.path.insert over sys.path.append. With the path tweak being reportedly faster. Suggested-by: Dylan Baker <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Erik Faye-Lund <[email protected]>
Diffstat (limited to 'src/mapi/mapi_abi.py')
-rw-r--r--src/mapi/mapi_abi.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mapi/mapi_abi.py b/src/mapi/mapi_abi.py
index dc48fa5935f..bb505561e7c 100644
--- a/src/mapi/mapi_abi.py
+++ b/src/mapi/mapi_abi.py
@@ -29,8 +29,8 @@ from __future__ import print_function
import sys
# make it possible to import glapi
import os
-GLAPI = os.path.join(".", os.path.dirname(sys.argv[0]), "glapi/gen")
-sys.path.append(GLAPI)
+GLAPI = os.path.join(".", os.path.dirname(__file__), "glapi", "gen")
+sys.path.insert(0, GLAPI)
from operator import attrgetter
import re