mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
reuse certbot.util.is_exe
This commit is contained in:
parent
f5288c5bf3
commit
f312e073d4
1 changed files with 12 additions and 4 deletions
|
|
@ -91,6 +91,18 @@ def run_script(params, log=logger.error):
|
|||
return stdout, stderr
|
||||
|
||||
|
||||
def is_exe(path):
|
||||
"""Is path an executable file?
|
||||
|
||||
:param str path: path to test
|
||||
|
||||
:returns: True iff path is an executable file
|
||||
:rtype: bool
|
||||
|
||||
"""
|
||||
return os.path.isfile(path) and os.access(path, os.X_OK)
|
||||
|
||||
|
||||
def exe_exists(exe):
|
||||
"""Determine whether path/name refers to an executable.
|
||||
|
||||
|
|
@ -100,10 +112,6 @@ def exe_exists(exe):
|
|||
:rtype: bool
|
||||
|
||||
"""
|
||||
def is_exe(path):
|
||||
"""Determine if path is an exe."""
|
||||
return os.path.isfile(path) and os.access(path, os.X_OK)
|
||||
|
||||
path, _ = os.path.split(exe)
|
||||
if path:
|
||||
return is_exe(exe)
|
||||
|
|
|
|||
Loading…
Reference in a new issue