1
0
mirror of https://github.com/google/nomulus synced 2025-12-23 14:25:44 +00:00

Fixed distutils deprecation warning (#1711)

* Fixed distutils deprecation warning

Replace distutils.find_executable() with shutil.which().
This commit is contained in:
Michael Muller
2022-07-26 15:51:52 -04:00
committed by GitHub
parent d502438b3e
commit 343263cc19

View File

@@ -26,7 +26,7 @@ import re
import subprocess
import io
import sys
from distutils.spawn import find_executable
from shutil import which
def main():
parser = argparse.ArgumentParser(description=
@@ -93,7 +93,7 @@ def main():
elif args.google_java_format_jar:
base_command = [args.java_binary, '-jar', args.google_java_format_jar]
else:
binary = find_executable('google-java-format') or '/usr/bin/google-java-format'
binary = which('google-java-format') or '/usr/bin/google-java-format'
base_command = [binary]
# Reformat files containing changes in place.