Skip to content

Commit

Permalink
Update Lib/unittest/case.py
Browse files Browse the repository at this point in the history
Per carljm suggestion, removing unnecessary conditions.

Co-authored-by: Carl Meyer <carl@oddbird.net>
  • Loading branch information
mblahay and carljm committed May 4, 2023
1 parent cc191c7 commit 1990b4d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Lib/unittest/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -1236,13 +1236,13 @@ def assertMultiLineEqual(self, first, second, msg=None):
# \n should be added
first_presplit = first
second_presplit = second
if first != '' and second != '':
if first and second:
if first[-1] != '\n' or second[-1] != '\n':
first_presplit += '\n'
second_presplit += '\n'
elif first == '' and second != '' and second[-1] != '\n':
elif second and second[-1] != '\n':
second_presplit += '\n'
elif second == '' and first != '' and first[-1] != '\n':
elif first and first[-1] != '\n':
first_presplit += '\n'

firstlines = first_presplit.splitlines(keepends=True)
Expand Down

0 comments on commit 1990b4d

Please sign in to comment.