1d8370c9bf7f

Send strings to difflib.unified_diff

Python 3.5 adds type-checking to difflib, which causes gundo to fail.
This fixes the issue by converting the arguments to strings.
See https://bugs.python.org/issue17445 for details
[view raw] [browse files]
author Omar Khan <omar@omarkhan.me>
date Wed, 07 Oct 2015 10:34:15 +0700
parents eb9fc8676b89
children 80be9ec7656d
branches/tags (none)
files autoload/gundo.py

Changes

--- a/autoload/gundo.py	Wed Jul 10 20:37:26 2013 -0400
+++ b/autoload/gundo.py	Wed Oct 07 10:34:15 2015 +0700
@@ -361,7 +361,7 @@
 
         before_name = 'Original'
         before_time = ''
-        after_name = node_after.n
+        after_name = str(node_after.n)
         after_time = _fmt_time(node_after.time)
     else:
         _undo_to(node_before.n)
@@ -370,9 +370,9 @@
         _undo_to(node_after.n)
         after_lines = vim.current.buffer[:]
 
-        before_name = node_before.n
+        before_name = str(node_before.n)
         before_time = _fmt_time(node_before.time)
-        after_name = node_after.n
+        after_name = str(node_after.n)
         after_time = _fmt_time(node_after.time)
 
     _undo_to(current)
@@ -390,9 +390,9 @@
     _undo_to(node_after.n)
     after_lines = vim.current.buffer[:]
 
-    before_name = node_before.n or 'Original'
+    before_name = str(node_before.n or 'Original')
     before_time = node_before.time and _fmt_time(node_before.time) or ''
-    after_name = node_after.n or 'Original'
+    after_name = str(node_after.n or 'Original')
     after_time = node_after.time and _fmt_time(node_after.time) or ''
 
     _undo_to(current)