1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-25 17:36:13 +01:00

- do not crash if there is no diff

This commit is contained in:
Michael Schroeder 2010-10-29 17:30:56 +02:00
parent 65e5af303a
commit 6b618b29be

View File

@ -3620,8 +3620,9 @@ def get_source_file_diff(dir, filename, rev, oldfilename = None, olddir = None,
d = list(d) d = list(d)
# python2.7's difflib slightly changed the format # python2.7's difflib slightly changed the format
# adapt old format to the new format # adapt old format to the new format
d[0] = d[0].replace(' \n', '\n') if len(d) > 1:
d[1] = d[1].replace(' \n', '\n') d[0] = d[0].replace(' \n', '\n')
d[1] = d[1].replace(' \n', '\n')
# if file doesn't end with newline, we need to append one in the diff result # if file doesn't end with newline, we need to append one in the diff result
for i, line in enumerate(d): for i, line in enumerate(d):