From 34ce774acdec54398940a0f8df88fb1b1751c68d Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 21 Nov 2014 09:39:49 +0100 Subject: [PATCH] Patch for an Issue #956 --- lib/request/comparison.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/request/comparison.py b/lib/request/comparison.py index 0966c3695..0be79635e 100644 --- a/lib/request/comparison.py +++ b/lib/request/comparison.py @@ -132,8 +132,15 @@ def _comparison(page, headers, code, getRatioValue, pageLength): seq1 = seq1[count:] seq2 = seq2[count:] - seqMatcher.set_seq1(seq1) - seqMatcher.set_seq2(seq2) + while True: + try: + seqMatcher.set_seq1(seq1) + seqMatcher.set_seq2(seq2) + except MemoryError: + seq1 = seq1[:len(seq1) / 4] + seq2 = seq2[:len(seq2) / 4] + else: + break ratio = round(seqMatcher.quick_ratio(), 3)