From 821f71cc4c7544aa56a08fdc394bfddabc87ca84 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 13 Dec 2021 20:11:30 +0530 Subject: [PATCH] Fix test failing on python 3.10 --- src/calibre/srv/tests/auth.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/calibre/srv/tests/auth.py b/src/calibre/srv/tests/auth.py index 4ed05922a5..13eb573c92 100644 --- a/src/calibre/srv/tests/auth.py +++ b/src/calibre/srv/tests/auth.py @@ -5,12 +5,8 @@ __license__ = 'GPL v3' __copyright__ = '2015, Kovid Goyal ' -import subprocess, os, time +import subprocess, os, time, shutil from collections import namedtuple -try: - from distutils.spawn import find_executable -except ImportError: # windows - find_executable = lambda x: None from calibre.ptempfile import TemporaryDirectory from calibre.srv.errors import HTTPForbidden @@ -234,7 +230,7 @@ class TestAuth(BaseTest): self.ae(urlopen(server).read(), b'closed') # Check using curl - curl = find_executable('curl') + curl = shutil.which('curl') if curl: def docurl(data, *args): cmd = [curl] + list(args) + ['http://localhost:%d/closed' % server.address[1]]