Fix #2052 (Improve error handling in get_results method)

This commit is contained in:
Kovid Goyal 2023-10-03 07:39:37 +05:30
parent 2d000bf23e
commit da24ae6480
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -20,6 +20,9 @@ from calibre.utils.search_query_parser import SearchQueryParser
def comparable_price(text):
if isinstance(text, (int, float)):
text = str(text)
text = text or ''
# this keep thousand and fraction separators
match = re.search(r'(?:\d|[,.](?=\d))(?:\d*(?:[,.\' ](?=\d))?)+', text)
if match: