def get_diff_text(old, new, filename):
 newline = u'\n'
 diff = difflib.unified_diff(old, new, (u'original/' + filename), (u'fixed/' + filename), lineterm=newline)
 text = u''
 for line in diff:
  text += line
  if (text and (not line.endswith(newline))):
   text += ((newline + u'\\ No newline at end of file') + newline)
 return text

def get_diff_text ( old , new , filename ) : newline = u'\n' diff = difflib . unified_diff ( old , new , ( u'original/' + filename ) , ( u'fixed/' + filename ) , lineterm = newline ) text = u'' for line in diff : text += line if ( text and ( not line . endswith ( newline ) ) ) : text += ( ( newline + u'\\ No newline at end of file' ) + newline ) return text
return text of unified diff between old and new .