summaryrefslogtreecommitdiffstats
path: root/minify_web_js.py
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2021-12-13 21:10:42 +0000
committerCalum Lind <calumlind+deluge@gmail.com>2021-12-13 23:57:09 +0000
commit073bbbc09df1f3aa91610b70c05406611eac3975 (patch)
tree0687615f2f1d6cebefb36c05e2e7a4025f0773ce /minify_web_js.py
parentbca0aa35320c2172f28498e9d596323c2117b696 (diff)
downloaddeluge-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-xminify_web_js.py9
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