diff options
author | Raymond Hettinger <python@rcn.com> | 2014-06-21 18:57:36 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2014-06-21 18:57:36 (GMT) |
commit | fabefc3c5b9e174e4eef2cb351a6ed8c81d721b0 (patch) | |
tree | f7b6e74a14c8feef6c67dbc7ff6b51616eb0d712 /Lib/difflib.py | |
parent | 8aa9e4268fae4646b40d230962d74a6b61397217 (diff) | |
download | cpython-fabefc3c5b9e174e4eef2cb351a6ed8c81d721b0.zip cpython-fabefc3c5b9e174e4eef2cb351a6ed8c81d721b0.tar.gz cpython-fabefc3c5b9e174e4eef2cb351a6ed8c81d721b0.tar.bz2 |
Issue 21635: Fix caching in difflib.SequenceMatcher.get_matching_blocks().
Diffstat (limited to 'Lib/difflib.py')
-rw-r--r-- | Lib/difflib.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/difflib.py b/Lib/difflib.py index 38dfef4..7eb42a9 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. |