mirror of
https://github.com/google/nomulus.git
synced 2025-07-13 22:45:10 +02:00
Fixed distutils deprecation warning (#1711)
* Fixed distutils deprecation warning Replace distutils.find_executable() with shutil.which().
This commit is contained in:
parent
5657089ffc
commit
169340298c
1 changed files with 2 additions and 2 deletions
|
@ -26,7 +26,7 @@ import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import io
|
import io
|
||||||
import sys
|
import sys
|
||||||
from distutils.spawn import find_executable
|
from shutil import which
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser(description=
|
parser = argparse.ArgumentParser(description=
|
||||||
|
@ -93,7 +93,7 @@ def main():
|
||||||
elif args.google_java_format_jar:
|
elif args.google_java_format_jar:
|
||||||
base_command = [args.java_binary, '-jar', args.google_java_format_jar]
|
base_command = [args.java_binary, '-jar', args.google_java_format_jar]
|
||||||
else:
|
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]
|
base_command = [binary]
|
||||||
|
|
||||||
# Reformat files containing changes in place.
|
# Reformat files containing changes in place.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue