From fabefc3c5b9e174e4eef2cb351a6ed8c81d721b0 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Sat, 21 Jun 2014 11:57:36 -0700 Subject: Issue 21635: Fix caching in difflib.SequenceMatcher.get_matching_blocks(). --- Lib/difflib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/difflib.py') diff --git a/Lib/difflib.py b/Lib/difflib.py index 38dfef46191..7eb42a927b0 100644 --- a/Lib/difflib.py +++ b/Lib/difflib.py @@ -511,8 +511,8 @@ class SequenceMatcher: non_adjacent.append((i1, j1, k1)) non_adjacent.append( (la, lb, 0) ) - self.matching_blocks = non_adjacent - return map(Match._make, self.matching_blocks) + self.matching_blocks = list(map(Match._make, non_adjacent)) + return self.matching_blocks def get_opcodes(self): """Return list of 5-tuples describing how to turn a into b. -- cgit v1.2.3