From a29bc33048b39076b71ce3aa770c660a18eb57d4 Mon Sep 17 00:00:00 2001 From: John Sirois Date: Mon, 24 Jun 2019 18:53:19 -0600 Subject: [PATCH] Simplify try_create. --- pex/pex_bootstrapper.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pex/pex_bootstrapper.py b/pex/pex_bootstrapper.py index c1135b794..7bf039ad8 100644 --- a/pex/pex_bootstrapper.py +++ b/pex/pex_bootstrapper.py @@ -20,12 +20,10 @@ def _find_pex_python(pex_python): def try_create(try_path): - if os.path.exists(try_path): - try: - return PythonInterpreter.from_binary(try_path) - except Executor.ExecutionError: - pass - return None + try: + return PythonInterpreter.from_binary(try_path) + except Executor.ExecutionError: + return None interpreter = try_create(pex_python) if interpreter: