Skip to content

Commit 6dfbbaa

Browse files
committed
Fix for bug #1
1 parent ac01ea3 commit 6dfbbaa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

diff.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ def difference(self):
8080
d = tmp_file2.readlines()
8181
with open(diff, "w") as diff_file:
8282
for x in range(len(o)):
83-
diff_file.write(self.difflib_parser(o[x],d[x]))
83+
try:
84+
diff_file.write(self.difflib_parser(o[x],d[x]))
85+
except IndexError:
86+
pass
8487

8588
tmp_file1.close()
8689
tmp_file2.close()
@@ -124,6 +127,9 @@ def setupUi(self, MainWindow):
124127

125128
def display_diff(self):
126129
global file1, diff
130+
131+
self.textEdit.clear()
132+
self.textEdit_2.clear()
127133

128134
with open(file1, "r") as tmp_file1:
129135
for line in tmp_file1:

0 commit comments

Comments
 (0)