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:
Marek Marczykowski-Górecki 2020-07-02 02:56:13 +02:00
parent 39e07f93f8
commit 940b0f3646
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724
2 changed files with 2 additions and 4 deletions

1
debian/control vendored
View File

@ -40,7 +40,6 @@ Depends:
util-linux,
e2fsprogs,
python3-daemon,
python3-distutils,
python3-qubesdb,
python3-gi,
python3-xdg,

View File

@ -24,8 +24,7 @@ import logging
import os
import socket
import subprocess
from distutils import spawn
import shutil
import daemon
import qubesdb
@ -732,7 +731,7 @@ class NftablesWorker(FirewallWorker):
def main():
if spawn.find_executable('nft'):
if shutil.which('nft'):
worker = NftablesWorker()
else:
worker = IptablesWorker()