summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorClaude Paroz <claude@2xlibre.net>2020-06-15 07:42:51 +0200
committerGitHub <noreply@github.com>2020-06-15 08:42:51 +0300
commitce79e44d14f151e37316144f66dedb2ace2f37dc (patch)
tree5910a5d79adc3be4c787088c8ad040a01a1f3f0f /src
parent985c3d98b02b8bdb24f4a52a215eb4200912cfb6 (diff)
downloadtablib-ce79e44d14f151e37316144f66dedb2ace2f37dc.tar.gz
Fixes #469 - Prevented rst crash with only-space strings (#470)
Thanks nexone for the report.
Diffstat (limited to 'src')
-rw-r--r--src/tablib/formats/_rst.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tablib/formats/_rst.py b/src/tablib/formats/_rst.py
index 6dce91f..afbf1ca 100644
--- a/src/tablib/formats/_rst.py
+++ b/src/tablib/formats/_rst.py
@@ -24,7 +24,7 @@ def _max_word_len(text):
>>> _max_word_len('Python Module for Tabular Datasets')
8
"""
- return max(len(word) for word in text.split()) if text else 0
+ return max([len(word) for word in text.split()], default=0) if text else 0
class ReSTFormat: