mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-18 12:06:04 +00:00
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.
This commit is contained in:
parent
c719712b62
commit
26bdceacbf
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user