From f312e073d4107a6595566253256409aeca5908fc Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Fri, 22 Sep 2017 17:28:44 -0700 Subject: [PATCH] reuse certbot.util.is_exe --- certbot/util.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/certbot/util.py b/certbot/util.py index 98424b496..30de0c157 100644 --- a/certbot/util.py +++ b/certbot/util.py @@ -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)