mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
8365f503da
commit
389d00009b
@ -88,10 +88,9 @@ def shorten_components_to(length, components, more_to_take=0, last_has_extension
|
||||
def find_executable_in_path(name, path=None):
|
||||
if path is None:
|
||||
path = os.environ.get('PATH', '')
|
||||
sep = ';' if iswindows else ':'
|
||||
if iswindows and not name.endswith('.exe'):
|
||||
name += '.exe'
|
||||
path = path.split(sep)
|
||||
path = path.split(os.pathsep)
|
||||
for x in path:
|
||||
q = os.path.abspath(os.path.join(x, name))
|
||||
if os.access(q, os.X_OK):
|
||||
|
Loading…
x
Reference in New Issue
Block a user