Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
label = label[:-1]
else:
label = cast(
Text,
draw(text(
min_size=1, max_size=63,
alphabet=Text(ascii_letters + digits + u"-")
))
)
# Filter invalid labels.
# It would be better to reliably avoid generation of bogus labels in
# the first place, but it's hard...
try:
check_label(label)
except UnicodeError: # pragma: no cover (not always drawn)
assume(False)
return label