Skip to content

Commit 48c041a

Browse files
authored
Remove use of distutils
Distutils will be deprecated in python 3.12, see [PEP 632](https://www.python.org/dev/peps/pep-0632/). `shutil.which` is the recommended replacement for `distutils.spawn.find_executable`.
1 parent 96a8b90 commit 48c041a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/google-java-format-diff.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import subprocess
3434
import io
3535
import sys
36-
from distutils.spawn import find_executable
36+
from shutil import which
3737

3838
def main():
3939
parser = argparse.ArgumentParser(description=
@@ -105,7 +105,7 @@ def main():
105105
elif args.google_java_format_jar:
106106
base_command = ['java', '-jar', args.google_java_format_jar]
107107
else:
108-
binary = find_executable('google-java-format') or '/usr/bin/google-java-format'
108+
binary = which('google-java-format') or '/usr/bin/google-java-format'
109109
base_command = [binary]
110110

111111
# Reformat files containing changes in place.

0 commit comments

Comments
 (0)