Check that the pack virtualenv exists before trying to list its contents
@@ -141,9 +141,7 @@ def get_sandbox_python_path_for_python_action(pack, inherit_from_parent=True,
pack_base_path = get_pack_base_path(pack_name=pack)
virtualenv_path = get_sandbox_virtualenv_path(pack=pack)
- if not virtualenv_path:
- return sandbox_python_path
-
+ if virtualenv_path and os.path.isdir(virtualenv_path):
pack_virtualenv_lib_path = os.path.join(virtualenv_path, 'lib')
virtualenv_directories = os.listdir(pack_virtualenv_lib_path)
