зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1638780 - Don't import `virtualenv` unless necessary in `mach` commands r=froydnj
The module `distutils.sysconfig` isn't installed by default on Ubuntu -- the package `python3-distutils` exposes it. That's fine, except we unconditionally import it in `virtualenv.py`, which gets up indirectly being imported whenever you run any `mach` command, which will cause `bootstrap` to break before it even has the chance to install it. `python3-pip` seems to rely on `python3-distutils` being installed so `bootstrap` will install it, so all we need to do is make sure it doesn't import `virtualenv` in any circumstance unless it's necessary (when surfacing an error in the module would be appropriate). Differential Revision: https://phabricator.services.mozilla.com/D75833
This commit is contained in:
Родитель
8ddc16d1ad
Коммит
57d020b2e6
|
@ -42,7 +42,6 @@ from .util import (
|
||||||
memoize,
|
memoize,
|
||||||
memoized_property,
|
memoized_property,
|
||||||
)
|
)
|
||||||
from .virtualenv import VirtualenvManager
|
|
||||||
|
|
||||||
|
|
||||||
def ancestors(path):
|
def ancestors(path):
|
||||||
|
@ -273,6 +272,8 @@ class MozbuildObject(ProcessExecutionMixin):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def virtualenv_manager(self):
|
def virtualenv_manager(self):
|
||||||
|
from .virtualenv import VirtualenvManager
|
||||||
|
|
||||||
if self._virtualenv_manager is None:
|
if self._virtualenv_manager is None:
|
||||||
name = "init"
|
name = "init"
|
||||||
if six.PY3:
|
if six.PY3:
|
||||||
|
|
Загрузка…
Ссылка в новой задаче