Skip to content

Commit 655ef5b

Browse files
mblahaycarljm
andauthored
Update Lib/unittest/case.py
Per carljm suggestion, removing unnecessary conditions. Co-authored-by: Carl Meyer <carl@oddbird.net>
1 parent 506e2ed commit 655ef5b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/unittest/case.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1236,13 +1236,13 @@ def assertMultiLineEqual(self, first, second, msg=None):
12361236
# \n should be added
12371237
first_presplit = first
12381238
second_presplit = second
1239-
if first != '' and second != '':
1239+
if first and second:
12401240
if first[-1] != '\n' or second[-1] != '\n':
12411241
first_presplit += '\n'
12421242
second_presplit += '\n'
1243-
elif first == '' and second != '' and second[-1] != '\n':
1243+
elif second and second[-1] != '\n':
12441244
second_presplit += '\n'
1245-
elif second == '' and first != '' and first[-1] != '\n':
1245+
elif first and first[-1] != '\n':
12461246
first_presplit += '\n'
12471247

12481248
firstlines = first_presplit.splitlines(keepends=True)

0 commit comments

Comments
 (0)