From ce79e44d14f151e37316144f66dedb2ace2f37dc Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Mon, 15 Jun 2020 07:42:51 +0200 Subject: Fixes #469 - Prevented rst crash with only-space strings (#470) Thanks nexone for the report. --- src/tablib/formats/_rst.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/tablib') 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: -- cgit v1.2.1