Fix #1914954 [ValueError: could not convert string to float: 'XV'](https://bugs.launchpad.net/calibre/+bug/1914954)

This commit is contained in:
Kovid Goyal 2021-02-08 11:33:15 +05:30
parent 2e0b2d1573
commit 3746562f81
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -220,7 +220,7 @@ def fmt_sidx(i, fmt='%.2f', use_roman=False):
i = 1 i = 1
try: try:
i = float(i) i = float(i)
except TypeError: except Exception:
return unicode_type(i) return unicode_type(i)
if int(i) == float(i): if int(i) == float(i):
return roman(int(i)) if use_roman else '%d'%int(i) return roman(int(i)) if use_roman else '%d'%int(i)