Do not use legacy distutils.spawn
The whole distutils module is a legacy thing in python3. Specifically, most of it is not installed in Debian by default (there is only distutils.version). Depending on python3-distutils is problematic, as it's availability varies between Debian versions. Instead of fighting with special cases in dependencies, replace the whole thing with non-legacy shutil.which() (available since Python 3.3).
This commit is contained in:
parent
39e07f93f8
commit
940b0f3646
1
debian/control
vendored
1
debian/control
vendored
@ -40,7 +40,6 @@ Depends:
|
|||||||
util-linux,
|
util-linux,
|
||||||
e2fsprogs,
|
e2fsprogs,
|
||||||
python3-daemon,
|
python3-daemon,
|
||||||
python3-distutils,
|
|
||||||
python3-qubesdb,
|
python3-qubesdb,
|
||||||
python3-gi,
|
python3-gi,
|
||||||
python3-xdg,
|
python3-xdg,
|
||||||
|
@ -24,8 +24,7 @@ import logging
|
|||||||
import os
|
import os
|
||||||
import socket
|
import socket
|
||||||
import subprocess
|
import subprocess
|
||||||
from distutils import spawn
|
import shutil
|
||||||
|
|
||||||
import daemon
|
import daemon
|
||||||
|
|
||||||
import qubesdb
|
import qubesdb
|
||||||
@ -732,7 +731,7 @@ class NftablesWorker(FirewallWorker):
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
if spawn.find_executable('nft'):
|
if shutil.which('nft'):
|
||||||
worker = NftablesWorker()
|
worker = NftablesWorker()
|
||||||
else:
|
else:
|
||||||
worker = IptablesWorker()
|
worker = IptablesWorker()
|
||||||
|
Loading…
Reference in New Issue
Block a user