1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

gpo: Avoid using distutils since it will be deprecated

We shouldn't use distutils.spawn.find-executable
here, since its use is discouraged:
https://docs.python.org/3/library/distutils.html

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
David Mulder 2020-08-06 15:18:16 -06:00 committed by David Mulder
parent 0a7e2e3984
commit 0544237ea2

View File

@ -19,7 +19,14 @@ from samba.gpclass import gp_pol_ext
from base64 import b64encode from base64 import b64encode
from tempfile import NamedTemporaryFile from tempfile import NamedTemporaryFile
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
from distutils.spawn import find_executable
def find_executable(executable, path):
paths = path.split(os.pathsep)
for p in paths:
f = os.path.join(p, executable)
if os.path.isfile(f):
return f
return None
intro = ''' intro = '''
### autogenerated by samba ### autogenerated by samba