TXT Output: Fix max line length option not working

py3 regression.

Fixes #1941992 [TXT Output crashes when --max-line-length option is set](https://bugs.launchpad.net/calibre/+bug/1941992)
This commit is contained in:
Kovid Goyal 2021-08-29 19:06:46 +05:30
parent 803c3826fd
commit 9b46b4ab76
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -150,8 +150,8 @@ class TXTMLizer(object):
text = re.sub(r'(?u)^[ \n]+', '', text) text = re.sub(r'(?u)^[ \n]+', '', text)
if self.opts.max_line_length: if self.opts.max_line_length:
max_length = self.opts.max_line_length max_length = int(self.opts.max_line_length)
if self.opts.max_line_length < 25 and not self.opts.force_max_line_length: if max_length < 25 and not self.opts.force_max_line_length:
max_length = 25 max_length = 25
short_lines = [] short_lines = []
lines = text.splitlines() lines = text.splitlines()