From 737154d6577c2192f4e6f9d1125ca2513c94298b Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 14 Apr 2018 01:47:17 +0200 Subject: [PATCH] Remove an unnecessary else --- jedi/api/environment.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/jedi/api/environment.py b/jedi/api/environment.py index a83d2d0f..60ee19e6 100644 --- a/jedi/api/environment.py +++ b/jedi/api/environment.py @@ -336,17 +336,17 @@ def _is_safe(executable_path): for environment in find_python_environments(): if environment.executable == real_path: return True - else: - # If the versions don't match, just compare the binary files. If we - # don't do that, only venvs will be working and not virtualenvs. - # venvs are symlinks while virtualenvs are actual copies of the - # Python files. - # This still means that if the system Python is updated and the - # virtualenv's Python is not (which is probably never going to get - # upgraded), it will not work with Jedi. IMO that's fine, because - # people should just be using venv. ~ dave - if environment._sha256 == _calculate_sha256_for_file(real_path): - return True + + # If the versions don't match, just compare the binary files. If we + # don't do that, only venvs will be working and not virtualenvs. + # venvs are symlinks while virtualenvs are actual copies of the + # Python files. + # This still means that if the system Python is updated and the + # virtualenv's Python is not (which is probably never going to get + # upgraded), it will not work with Jedi. IMO that's fine, because + # people should just be using venv. ~ dave + if environment._sha256 == _calculate_sha256_for_file(real_path): + return True return False