mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
mach: use importlib
module instead of imp
(#30645)
* mach: use `importlib` module instead of `imp` `imp` module has been deprecated since python 3.4 and has been removed in 3.12. The recommended alternative is to use the `importlib` module that was introduced in python 3.1 This is required to fix the CI failures in macos builds since GitHub runner images for macos-13 now use python 3.12 Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> * mach: use `importlib` module instead of `imp` `imp` module has been deprecated since python 3.4 and has been removed in 3.12. The recommended alternative is to use the `importlib` module that was introduced in python 3.1 This is required to fix the CI failures in macos builds since GitHub runner images for macos-13 now use python 3.12 Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com> --------- Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
parent
3fde61f2e5
commit
117cc1da6c
2 changed files with 10 additions and 14 deletions
|
@ -140,10 +140,10 @@ def _activate_virtualenv(topdir):
|
|||
activate_path = os.path.join(virtualenv_path, script_dir, "activate_this.py")
|
||||
need_pip_upgrade = False
|
||||
if not (os.path.exists(virtualenv_path) and os.path.exists(activate_path)):
|
||||
import imp
|
||||
import importlib
|
||||
try:
|
||||
imp.find_module('virtualenv')
|
||||
except ImportError:
|
||||
importlib.import_module('virtualenv')
|
||||
except ModuleNotFoundError:
|
||||
sys.exit("Python virtualenv is not installed. Please install it prior to running mach.")
|
||||
|
||||
_process_exec([python, "-m", "virtualenv", "-p", python, "--system-site-packages", virtualenv_path])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue