10 FILE = os.path.realpath(__file__)
11 if not gi.overrides.__path__[0].endswith("gst-python/gi/overrides"):
12 local_overrides = None
13 # our overrides don't take precedence, let's fix it
14 for i, path in enumerate(gi.overrides.__path__):
15 if path.endswith("gst-python/gi/overrides"):
16 local_overrides = path
19 gi.overrides.__path__.remove(local_overrides)
21 local_overrides = os.path.abspath(os.path.join(FILE, "../", "../", "gi", "overrides"))
23 gi.overrides.__path__.insert(0, local_overrides)
26 gi.overrides.__path__.insert(0, os.path.abspath(os.path.join(mesonconfig.path, "gi", "overrides")))
27 # Execute previously set sitecustomize.py script if it existed
28 if os.environ.get("GST_ENV"):
29 old_sitecustomize = os.path.join(os.path.dirname(__file__),
30 "old.sitecustomize.gstuninstalled.py")
31 if os.path.exists(old_sitecustomize):
32 exec(compile(open(old_sitecustomize).read(), old_sitecustomize, 'exec'))