Skip to content

Commit b889e16

Browse files
committed
ignore empty flag value
1 parent 7982332 commit b889e16

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

python/private/config_settings.bzl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,19 @@ def is_python_version_at_least(name, **kwargs):
225225
)
226226

227227
def _python_version_at_least_impl(ctx):
228-
at_least = tuple([int(x) for x in ctx.attr.at_least.split(".")])
228+
flag_value = ctx.attr._major_minor[config_common.FeatureFlagInfo].value
229+
230+
# CI is, somehow, getting an empty string for the current flag value.
231+
# How isn't clear.
232+
if not flag_value:
233+
return "no"
234+
229235
current = tuple([
230236
int(x)
231-
for x in ctx.attr._major_minor[config_common.FeatureFlagInfo].value.split(".")
237+
for x in flag_value.split(".")
232238
])
239+
at_least = tuple([int(x) for x in ctx.attr.at_least.split(".")])
240+
233241
value = "yes" if current >= at_least else "no"
234242
return [config_common.FeatureFlagInfo(value = value)]
235243

0 commit comments

Comments
 (0)