diff --git a/udiskie/mount.py b/udiskie/mount.py index d7e30e2..9a0422d 100644 --- a/udiskie/mount.py +++ b/udiskie/mount.py @@ -2,9 +2,9 @@ Mount utilities. """ -from distutils.spawn import find_executable from collections import namedtuple from functools import partial +from shutil import which import logging import os @@ -169,7 +169,7 @@ async def mount(self, device): return True def _check_device_before_mount(self, device): - if device.id_type == 'ntfs' and not find_executable('ntfs-3g'): + if device.id_type == 'ntfs' and not which('ntfs-3g'): self._log.warn(_( "Mounting NTFS device with default driver.\n" "Please install 'ntfs-3g' if you experience problems or the " diff --git a/udiskie/prompt.py b/udiskie/prompt.py index c1075d4..b703f23 100644 --- a/udiskie/prompt.py +++ b/udiskie/prompt.py @@ -5,7 +5,7 @@ from udiskie.depend import has_Gtk, require_Gtk from udiskie.common import is_utf8 -from distutils.spawn import find_executable +from shutil import which import getpass import logging import shlex @@ -247,7 +247,7 @@ def browser(browser_name='xdg-open'): if not browser_name: return None argv = shlex.split(browser_name) - executable = find_executable(argv[0]) + executable = which(argv[0]) if executable is None: # Why not raise an exception? -I think it is more convenient (for # end users) to have a reasonable default, without enforcing it.