handle empty input in print_colon_kv
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Rio Liu 2021-08-30 17:37:48 -04:00
parent 8f5a2803a6
commit 5bae89a9fd
1 changed files with 3 additions and 0 deletions

View File

@ -28,6 +28,9 @@ def print_colon_kv(pairs: List[Tuple[str, str]]):
key1: value1
key1000: value2
"""
if len(pairs) == 0:
return
maxlen = max(len(key) for key, val in pairs)
for key, val in pairs:
if key != '':