st/mesa: allow R8 to not be exposed as renderable by driver
[mesa.git] / src / mesa / main / get_hash_generator.py
index facdccd8a53f3637686dbc2a145baf9f31bf06f0..3e9032bd4c82d95ba4f4b09148817fb0a6c126c4 100644 (file)
 
 from __future__ import print_function
 
-import os, sys, imp, getopt
+import os, sys, getopt
 from collections import defaultdict
 import get_hash_params
 
-cur_dir = os.path.dirname(sys.argv[0])
-param_desc_file = "%s/get_hash_params.py" % cur_dir
+param_desc_file = os.path.join(os.path.dirname(__file__), "get_hash_params.py")
 
-GLAPI = "%s/../../mapi/glapi/gen" % cur_dir
-sys.path.append(GLAPI)
+GLAPI = os.path.join(os.path.dirname(__file__), "..", "..", "mapi", "glapi", "gen")
+sys.path.insert(0, GLAPI)
 import gl_XML
 
 prime_factor = 89
@@ -117,8 +116,8 @@ def print_tables(tables):
 def merge_tables(tables):
    merged_tables = []
    for api, indices in sorted(tables.items()):
-      matching_table = filter(lambda mt:mt["indices"] == indices,
-                              merged_tables)
+      matching_table = list(filter(lambda mt:mt["indices"] == indices,
+                              merged_tables))
       if matching_table:
          matching_table[0]["apis"].append(api)
       else: