Skip to content

Commit

Permalink
Fix TypeError when using Python 3
Browse files Browse the repository at this point in the history
The error shows up on :Gundo and looks like this:

    Error detected while processing function gundo#GundoShow[1]..<SNR>116_GundoShow[4]..<SNR>116_GundoOpen[31]..<SNR>116_GundoRenderPreview:
    line    2:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/mg/.vim/bundle/Gundo/autoload/gundo.py", line 474, in GundoRenderPreview
        _output_preview_text(_generate_preview_diff(current, node_before, node_after))
      File "/home/mg/.vim/bundle/Gundo/autoload/gundo.py", line 382, in _generate_preview_diff
        before_time, after_time))
      File "/usr/lib/python3.5/difflib.py", line 1177, in unified_diff
        _check_types(a, b, fromfile, tofile, fromfiledate, tofiledate, lineterm)
      File "/usr/lib/python3.5/difflib.py", line 1312, in _check_types
        raise TypeError('all arguments must be str, not: %r' % (arg,))
    TypeError: all arguments must be str, not: 46
  • Loading branch information
mgedmin committed Nov 24, 2016
1 parent e7fe410 commit e5dc5f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions autoload/gundo.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def _generate_preview_diff(current, node_before, node_after):
_undo_to(current)

return list(difflib.unified_diff(before_lines, after_lines,
before_name, after_name,
str(before_name), str(after_name),
before_time, after_time))

def _generate_change_preview_diff(current, node_before, node_after):
Expand All @@ -398,7 +398,7 @@ def _generate_change_preview_diff(current, node_before, node_after):
_undo_to(current)

return list(difflib.unified_diff(before_lines, after_lines,
before_name, after_name,
str(before_name), str(after_name),
before_time, after_time))

def GundoRenderGraph():
Expand Down

0 comments on commit e5dc5f2

Please sign in to comment.