Skip to content

Commit ad69573

Browse files
committed
[SYCL][E2E] Remove use of distutils package
This package is deprecated and removed in python 3.12. PEP 632 recommends replacing distutils.spawn.find_executable with shutils.which, which should offer the same functionality. Also remove another python module which appears unused.
1 parent 746bfe1 commit ad69573

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

sycl/test-e2e/lit.cfg.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
import copy
66
import re
77
import subprocess
8-
import tempfile
98
import textwrap
10-
from distutils.spawn import find_executable
9+
import shutil
1110

1211
import lit.formats
1312
import lit.util
@@ -558,15 +557,15 @@
558557
else:
559558
lit_config.warning("Can't find " + tool.key)
560559

561-
if find_executable("cmc"):
560+
if shutil.which("cmc") is not None:
562561
config.available_features.add("cm-compiler")
563562

564563
# Device AOT compilation tools aren't part of the SYCL project,
565564
# so they need to be pre-installed on the machine
566565
aot_tools = ["ocloc", "opencl-aot"]
567566

568567
for aot_tool in aot_tools:
569-
if find_executable(aot_tool) is not None:
568+
if shutil.which(aot_tool) is not None:
570569
lit_config.note("Found pre-installed AOT device compiler " + aot_tool)
571570
config.available_features.add(aot_tool)
572571
else:

sycl/test/lit.cfg.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import re
66
import subprocess
77
import tempfile
8-
from distutils.spawn import find_executable
98

109
import lit.formats
1110
import lit.util

0 commit comments

Comments
 (0)