mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Stop using distutils (#30638)
This is removed from Python 3.12 so we can no longer rely on it. All of this functionality is either in `setuptools` or `shutil`.
This commit is contained in:
parent
6dd359193f
commit
463c61f34d
3 changed files with 4 additions and 8 deletions
|
@ -9,7 +9,6 @@ import platform
|
|||
import sys
|
||||
import shutil
|
||||
|
||||
from distutils.spawn import find_executable
|
||||
from subprocess import Popen
|
||||
from tempfile import TemporaryFile
|
||||
|
||||
|
@ -90,7 +89,7 @@ PYTHON_NAMES = ["python-2.7", "python2.7", "python2", "python"]
|
|||
|
||||
def _get_exec_path(names, is_valid_path=lambda _path: True):
|
||||
for name in names:
|
||||
path = find_executable(name)
|
||||
path = shutil.which(name)
|
||||
if path and is_valid_path(path):
|
||||
return path
|
||||
return None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue