diff options
author | Calum Lind <calumlind+deluge@gmail.com> | 2021-12-13 21:10:42 +0000 |
---|---|---|
committer | Calum Lind <calumlind+deluge@gmail.com> | 2021-12-13 23:57:09 +0000 |
commit | 073bbbc09df1f3aa91610b70c05406611eac3975 (patch) | |
tree | 0687615f2f1d6cebefb36c05e2e7a4025f0773ce /minify_web_js.py | |
parent | bca0aa35320c2172f28498e9d596323c2117b696 (diff) | |
download | deluge-073bbbc09df1f3aa91610b70c05406611eac3975.tar.gz deluge-073bbbc09df1f3aa91610b70c05406611eac3975.tar.bz2 deluge-073bbbc09df1f3aa91610b70c05406611eac3975.zip |
[Packaging] Start replacing deprecated distutils
Working towards removing distutils
> direct usage of distutils is now actively discouraged,
with setuptools being the preferred replacement.
Ref: https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html
Diffstat (limited to 'minify_web_js.py')
-rwxr-xr-x | minify_web_js.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/minify_web_js.py b/minify_web_js.py index ff459e795..18f2d2343 100755 --- a/minify_web_js.py +++ b/minify_web_js.py @@ -22,11 +22,16 @@ import fnmatch import os import subprocess import sys -from distutils.spawn import find_executable + +try: + from shutil import which +except ImportError: + # PY2 Fallback + from distutils.spawn import find_executable as which closure_cmd = None for cmd in ['closure-compiler', 'closure']: - if find_executable(cmd): + if which(cmd): closure_cmd = cmd break |