Clean up conditional

pull/24452/head
Richard Belleville 4 years ago
parent 6ebc314ba1
commit 6295f7ba41
  1. 15
      third_party/py/python_configure.bzl

@ -291,15 +291,14 @@ def _create_single_version_package(
"""Creates the repository containing files set up to build with Python.""" """Creates the repository containing files set up to build with Python."""
empty_include_rule = "filegroup(\n name=\"{}_include\",\n srcs=[],\n)".format(variety_name) empty_include_rule = "filegroup(\n name=\"{}_include\",\n srcs=[],\n)".format(variety_name)
# A for loop is used in place of a (non-existent in Starlark) goto. python_bin = _get_python_bin(repository_ctx, bin_path_key, default_bin_path, allow_absent)
for _ in [None]: if (python_bin == None or
python_bin = _get_python_bin(repository_ctx, bin_path_key, default_bin_path, allow_absent) _check_python_bin(repository_ctx,
if python_bin == None and allow_absent: python_bin,
bin_path_key,
allow_absent) == None) and allow_absent:
python_include_rule = empty_include_rule python_include_rule = empty_include_rule
break else:
if _check_python_bin(repository_ctx, python_bin, bin_path_key, allow_absent) == None and allow_absent:
python_include_rule = empty_include_rule
break
python_lib = _get_python_lib(repository_ctx, python_bin, lib_path_key) python_lib = _get_python_lib(repository_ctx, python_bin, lib_path_key)
_check_python_lib(repository_ctx, python_lib) _check_python_lib(repository_ctx, python_lib)
python_include = _get_python_include(repository_ctx, python_bin) python_include = _get_python_include(repository_ctx, python_bin)

Loading…
Cancel
Save