diff options
author | Raymond Hettinger <python@rcn.com> | 2014-06-21 18:27:36 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2014-06-21 18:27:36 (GMT) |
commit | 4575010943c7a6013fad39a9c31e07e3c498a3ce (patch) | |
tree | 15f224cdbcca568e0be6d6fed374e126638049e9 /Lib/difflib.py | |
parent | 94919a44a26b135108788f5a7bd5604189c3febe (diff) | |
download | cpython-4575010943c7a6013fad39a9c31e07e3c498a3ce.zip cpython-4575010943c7a6013fad39a9c31e07e3c498a3ce.tar.gz cpython-4575010943c7a6013fad39a9c31e07e3c498a3ce.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 5dac1d6..3880d84 100644 --- a/Lib/difflib.py +++ b/Lib/difflib.py @@ -523,8 +523,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 = 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. |