mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #2052 (Improve error handling in get_results method)
This commit is contained in:
parent
2d000bf23e
commit
da24ae6480
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user