From 1e014de6be1c77991717496bb077f586aa9851c7 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 26 Dec 2014 22:24:28 +0100 Subject: [PATCH] Patch for an Issue #1066 --- lib/request/comparison.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/request/comparison.py b/lib/request/comparison.py index 0be79635e..f86c82e55 100644 --- a/lib/request/comparison.py +++ b/lib/request/comparison.py @@ -135,10 +135,16 @@ def _comparison(page, headers, code, getRatioValue, pageLength): while True: try: seqMatcher.set_seq1(seq1) + except MemoryError: + seq1 = seq1[:len(seq1) / 1024] + else: + break + + while True: + try: seqMatcher.set_seq2(seq2) except MemoryError: - seq1 = seq1[:len(seq1) / 4] - seq2 = seq2[:len(seq2) / 4] + seq2 = seq2[:len(seq2) / 1024] else: break