Skip to content

Commit b8977c8

Browse files
committed
Promote _mdiff to a standard method
1 parent f81c03a commit b8977c8

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/difflib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,7 @@ def ndiff(a, b, linejunk=None, charjunk=IS_CHARACTER_JUNK):
13581358
"""
13591359
return Differ(linejunk, charjunk).compare(a, b)
13601360

1361-
def _mdiff(fromlines, tolines, context=None, linejunk=None,
1361+
def mdiff(fromlines, tolines, context=None, linejunk=None,
13621362
charjunk=IS_CHARACTER_JUNK):
13631363
r"""Returns generator yielding marked up from/to side by side differences.
13641364
@@ -2025,7 +2025,7 @@ def make_table(self,fromlines,tolines,fromdesc='',todesc='',context=False,
20252025
context_lines = numlines
20262026
else:
20272027
context_lines = None
2028-
diffs = _mdiff(fromlines,tolines,context_lines,linejunk=self._linejunk,
2028+
diffs = mdiff(fromlines,tolines,context_lines,linejunk=self._linejunk,
20292029
charjunk=self._charjunk)
20302030

20312031
# set up iterator to wrap lines that exceed desired width

Lib/test/test_difflib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def test_hint_indented_properly_with_tabs(self):
114114
def test_mdiff_catch_stop_iteration(self):
115115
# Issue #33224
116116
self.assertEqual(
117-
list(difflib._mdiff(["2"], ["3"], 1)),
117+
list(difflib.mdiff(["2"], ["3"], 1)),
118118
[((1, '\x00-2\x01'), (1, '\x00+3\x01'), True)],
119119
)
120120

0 commit comments

Comments
 (0)