Skip to content

Commit 4a5feba

Browse files
committed
empty aligns no longer gives a KeyError
1 parent 95ae5eb commit 4a5feba

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tabulate/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2207,7 +2207,7 @@ def tabulate(
22072207
else: # default
22082208
aligns = [numalign if ct in [int, float] else stralign for ct in coltypes]
22092209
# then specific alignements
2210-
if colalign is not None:
2210+
if colalign is not None and aligns:
22112211
assert isinstance(colalign, Iterable)
22122212
if isinstance(colalign, str):
22132213
warnings.warn(f"As a string, `colalign` is interpreted as {[c for c in colalign]}. Did you mean `colglobalalign = \"{colalign}\"` or `colalign = (\"{colalign}\",)`?", stacklevel=2)

0 commit comments

Comments
 (0)