Skip to content

Commit

Permalink
Replace external dependency on distutils
Browse files Browse the repository at this point in the history
Fixes #278
  • Loading branch information
coldfix committed Dec 17, 2023
1 parent 540212a commit 5926543
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions udiskie/mount.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 "
Expand Down
4 changes: 2 additions & 2 deletions udiskie/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 5926543

Please sign in to comment.