mozext: use bootstrap.py (
bug 1244786); r?dminor
bootstrap.py exists to configure sys.path with every vendored Python
package path. mozext wasn't using this script - instead it was manually
configuring sys.path.
A recent change to mozautomation introduced requests as a dependency.
Since mozext wasn't inserting pylib/requests into sys.path, this could
result in an import failure due to requests not being found. Using
bootstrap.py adds pylib/requests and makes the ImportError go away.
--- a/hgext/mozext/__init__.py
+++ b/hgext/mozext/__init__.py
@@ -306,21 +306,18 @@ from mercurial import (
encoding,
error,
extensions,
hg,
scmutil,
util,
)
-OUR_DIR = os.path.dirname(__file__)
-REPO_ROOT = os.path.normpath(os.path.join(OUR_DIR, '..', '..'))
-PYLIB = os.path.join(REPO_ROOT, 'pylib')
-for p in ('flake8', 'mccabe', 'mozautomation', 'pep8', 'pyflakes'):
- sys.path.insert(0, os.path.join(PYLIB, p))
+OUR_DIR = os.path.normpath(os.path.dirname(__file__))
+execfile(os.path.join(OUR_DIR, '..', 'bootstrap.py'))
# Disable demand importing for mozautomation because "requests" doesn't
# play nice with the demand importer.
demandenabled = demandimport.isenabled()
try:
demandimport.disable()