Skip to content

Commit 8672146

Browse files
committed
Bug 1893961 - Remove distutils use from mozbase, , ahal r=Sasha
This has been removed from the stdlib in Python 3.12 Differential Revision: https://phabricator.services.mozilla.com/D208884
1 parent f60c1e1 commit 8672146

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

testing/mozbase/mozgeckoprofiler/mozgeckoprofiler/symbolication.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import http.client
66
import os
77
import platform
8+
import shutil
89
import subprocess
910
import zipfile
10-
from distutils import spawn
1111

1212
import six
1313
from mozlog import get_proxy_logger
@@ -95,7 +95,7 @@ def process_file(arch):
9595

9696
class LinuxSymbolDumper:
9797
def __init__(self):
98-
self.nm = spawn.find_executable("nm")
98+
self.nm = shutil.which("nm")
9999
if not self.nm:
100100
raise SymbolError("Could not find nm, necessary for symbol dumping")
101101

testing/mozbase/moznetwork/tests/test_moznetwork.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"""
55

66
import re
7+
import shutil
78
import subprocess
8-
from distutils.spawn import find_executable
99
from unittest import mock
1010

1111
import mozinfo
@@ -37,7 +37,7 @@ def ip_addresses():
3737

3838
cmd = None
3939
for command in commands:
40-
if find_executable(command[0]):
40+
if shutil.which(command[0]):
4141
cmd = command
4242
break
4343
else:

testing/mozbase/mozrunner/mozrunner/devices/android_device.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import sys
1414
import telnetlib
1515
import time
16-
from distutils.spawn import find_executable
1716
from enum import Enum
1817

1918
import six
@@ -942,7 +941,7 @@ def _find_sdk_exe(substs, exe, tools):
942941

943942
if not found:
944943
# Is exe on PATH?
945-
exe_path = find_executable(exe)
944+
exe_path = shutil.which(exe)
946945
if exe_path:
947946
found = True
948947
else:

0 commit comments

Comments
 (0)