mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 21:16:24 +00:00
Play nicely with gst-build uninstalled
As overrides_hack is being used as user sitecustomize script
This commit is contained in:
parent
490028ba21
commit
08d0d09fbd
1 changed files with 9 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
import os
|
||||
import gi.overrides
|
||||
|
||||
FILE = os.path.realpath(__file__)
|
||||
if not gi.overrides.__path__[0].endswith("gst-python/gi/overrides"):
|
||||
local_overrides = None
|
||||
# our overrides don't take precedence, let's fix it
|
||||
|
@ -11,6 +12,13 @@ if not gi.overrides.__path__[0].endswith("gst-python/gi/overrides"):
|
|||
if local_overrides:
|
||||
gi.overrides.__path__.remove(local_overrides)
|
||||
else:
|
||||
local_overrides = os.path.abspath(os.path.join(__file__, "../", "../", "gi", "overrides"))
|
||||
local_overrides = os.path.abspath(os.path.join(FILE, "../", "../", "gi", "overrides"))
|
||||
|
||||
gi.overrides.__path__.insert(0, local_overrides)
|
||||
|
||||
# Execute previously set sitecustomize.py script if it existed
|
||||
if os.environ.get("GST_ENV"):
|
||||
old_sitecustomize = os.path.join(os.path.dirname(__file__),
|
||||
"old.sitecustomize.gstuninstalled.py")
|
||||
if os.path.exists(old_sitecustomize):
|
||||
exec(compile(open(old_sitecustomize).read(), old_sitecustomize, 'exec'))
|
||||
|
|
Loading…
Reference in a new issue