Tests: the sys.meta_path trick does not work for python2

Instead, for python2 revert to manipulating gi.overrides.__path__
This commit is contained in:
Mathieu Duponchelle 2018-10-31 17:02:24 +01:00
parent d64bbc1e0c
commit f79ac2d143

View file

@ -25,4 +25,10 @@ class GstOverrideImport:
sys.modules[name] = module sys.modules[name] = module
return module return module
if sys.version_info.major >= 3:
sys.meta_path.insert(0, GstOverrideImport()) sys.meta_path.insert(0, GstOverrideImport())
else:
import gi.overrides
gi.overrides.__path__.append(os.environ.get('GST_OVERRIDE_SRC_PATH'))
gi.overrides.__path__.append(os.environ.get('GST_OVERRIDE_BUILD_PATH'))