From 26bdceacbfa0c76730c741185d028e35dbd637ed Mon Sep 17 00:00:00 2001 From: Joris Hartog Date: Thu, 18 Nov 2021 17:07:46 +0100 Subject: [PATCH] Remove distutils dependency The `distutils` library is deprecated. This commit replaces `distutils.spawn.find_executable` with `shutil.which`, which is in the standard library. Fixes #1246. --- thefuck/system/unix.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/thefuck/system/unix.py b/thefuck/system/unix.py index 9ae01cf4..1364bed9 100644 --- a/thefuck/system/unix.py +++ b/thefuck/system/unix.py @@ -3,7 +3,7 @@ import sys import tty import termios import colorama -from distutils.spawn import find_executable +import shutil from .. import const init_output = colorama.init @@ -38,7 +38,7 @@ def get_key(): def open_command(arg): - if find_executable('xdg-open'): + if shutil.which('xdg-open'): return 'xdg-open ' + arg return 'open ' + arg