This commit is contained in:
Miroslav Stampar
2025-12-31 00:28:44 +01:00
parent 33cd5d5055
commit db512c7603
3 changed files with 9 additions and 4 deletions

View File

@@ -182,7 +182,12 @@ def _comparison(page, headers, code, getRatioValue, pageLength):
if key in kb.cache.comparison:
ratio = kb.cache.comparison[key]
else:
ratio = round(seqMatcher.quick_ratio() if not kb.heavilyDynamic else seqMatcher.ratio(), 3)
try:
ratio = seqMatcher.quick_ratio() if not kb.heavilyDynamic else seqMatcher.ratio()
except (TypeError, MemoryError):
ratio = seqMatcher.ratio()
ratio = round(ratio, 3)
if key:
kb.cache.comparison[key] = ratio