Skip to content

Commit a2b143c

Browse files
committed
update difflib to 3.13.3
1 parent 92e72aa commit a2b143c

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

Lib/difflib.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,6 +1200,25 @@ def context_diff(a, b, fromfile='', tofile='',
12001200
strings for 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'.
12011201
The modification times are normally expressed in the ISO 8601 format.
12021202
If not specified, the strings default to blanks.
1203+
1204+
Example:
1205+
1206+
>>> print(''.join(context_diff('one\ntwo\nthree\nfour\n'.splitlines(True),
1207+
... 'zero\none\ntree\nfour\n'.splitlines(True), 'Original', 'Current')),
1208+
... end="")
1209+
*** Original
1210+
--- Current
1211+
***************
1212+
*** 1,4 ****
1213+
one
1214+
! two
1215+
! three
1216+
four
1217+
--- 1,4 ----
1218+
+ zero
1219+
one
1220+
! tree
1221+
four
12031222
"""
12041223

12051224
_check_types(a, b, fromfile, tofile, fromfiledate, tofiledate, lineterm)
@@ -1609,7 +1628,7 @@ def _line_pair_iterator():
16091628
</html>"""
16101629

16111630
_styles = """
1612-
table.diff {font-family:Courier; border:medium;}
1631+
table.diff {font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace; border:medium}
16131632
.diff_header {background-color:#e0e0e0}
16141633
td.diff_header {text-align:right}
16151634
.diff_next {background-color:#c0c0c0}

Lib/test/test_difflib.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ def test_mdiff_catch_stop_iteration(self):
186186
the end"""
187187

188188
class TestSFpatches(unittest.TestCase):
189+
189190
def test_html_diff(self):
190191
# Check SF patch 914575 for generating HTML differences
191192
f1a = ((patch914575_from1 + '123\n'*10)*3)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy