Skip to content

Commit d6e3d70

Browse files
committed
Use shutil.which instead of distutils.spawn in build_all_examples.py
The function distutils.spawn.find_executable is deprecated and should be replaced with shutil.which. Distutils itself is also no longer part of the standard library as of Python 3.12. ref #466
1 parent 6a82240 commit d6e3d70

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/build_all_examples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import os.path
66
import subprocess
77
import sys
8-
import distutils.spawn
8+
import shutil
99

1010
ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
1111

@@ -173,7 +173,7 @@ def gprbuild(project_file, debug=False):
173173
]
174174

175175
# Check if RISC-V32 compiler is available
176-
if distutils.spawn.find_executable("riscv64-elf-gnatls"):
176+
if shutil.which("riscv64-elf-gnatls"):
177177

178178
# Add RISC-V32 projects
179179
projects += ["/examples/HiFive1/hifive1_example.gpr"]

0 commit comments

Comments
 (0)