Browse Source

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).
Marek Marczykowski-Górecki 3 years ago
parent
commit
940b0f3646
2 changed files with 2 additions and 4 deletions
  1. 0 1
      debian/control
  2. 2 3
      qubesagent/firewall.py

+ 0 - 1
debian/control

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

+ 2 - 3
qubesagent/firewall.py

@@ -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()