Skip to content

Commit 134fd0a

Browse files
committed
fixup! cleanup the config settings implementation and mark the types as internal
1 parent 7858cd8 commit 134fd0a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

python/private/config_settings.bzl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,10 @@ def construct_config_settings(*, name, versions, minor_mapping): # buildifier:
5656
visibility = ["//visibility:public"],
5757
)
5858

59-
minor_versions = {}
59+
_reverse_minor_mapping = {full: minor for minor, full in minor_mapping.items()}
6060
for version in versions:
61-
minor_version, _, _ = version.rpartition(".")
62-
minor_versions[minor_version] = None
63-
64-
if minor_mapping[minor_version] != version:
61+
minor_version = _reverse_minor_mapping.get(version)
62+
if not minor_version:
6563
native.config_setting(
6664
name = "is_python_{}".format(version),
6765
flag_values = {":python_version": version},

0 commit comments

Comments
 (0)