updated for version 7.3.1003
Problem: Python interface does not compile with Python 2.2
Solution: Fix thread issues and True/False. (ZyX)
diff --git a/src/testdir/test86.in b/src/testdir/test86.in
index fac315e..d138a8d 100644
--- a/src/testdir/test86.in
+++ b/src/testdir/test86.in
@@ -518,6 +518,10 @@
:edit c
:buffer #
py << EOF
+try:
+ from __builtin__ import next
+except ImportError:
+ next = lambda o: o.next()
# Check GCing iterator that was not fully exhausted
i = iter(vim.buffers)
cb.append('i:' + str(next(i)))
@@ -577,15 +581,22 @@
cb.append('Number of tabs: ' + str(len(vim.tabpages)))
cb.append('Current tab pages:')
def W(w):
- if '(unknown)' in repr(w):
+ if repr(w).find('(unknown)') != -1:
return '<window object (unknown)>'
else:
return repr(w)
+
+def Cursor(w, start=len(cb)):
+ if w.buffer is cb:
+ return repr((start - w.cursor[0], w.cursor[1]))
+ else:
+ return repr(w.cursor)
+
for t in vim.tabpages:
cb.append(' ' + repr(t) + '(' + str(t.number) + ')' + ': ' + str(len(t.windows)) + ' windows, current is ' + W(t.window))
cb.append(' Windows:')
for w in t.windows:
- cb.append(' ' + W(w) + '(' + str(w.number) + ')' + ': displays buffer ' + repr(w.buffer) + '; cursor is at ' + repr(w.cursor))
+ cb.append(' ' + W(w) + '(' + str(w.number) + ')' + ': displays buffer ' + repr(w.buffer) + '; cursor is at ' + Cursor(w))
# Other values depend on the size of the terminal, so they are checked partly:
for attr in ('height', 'row', 'width', 'col'):
try:
diff --git a/src/testdir/test86.ok b/src/testdir/test86.ok
index 5602b2f..d64fa7c 100644
--- a/src/testdir/test86.ok
+++ b/src/testdir/test86.ok
@@ -333,7 +333,7 @@
Current tab pages:
<tabpage 0>(1): 1 windows, current is <window object (unknown)>
Windows:
- <window object (unknown)>(1): displays buffer <buffer test86.in>; cursor is at (990, 0)
+ <window object (unknown)>(1): displays buffer <buffer test86.in>; cursor is at (27, 0)
<tabpage 1>(2): 1 windows, current is <window object (unknown)>
Windows:
<window object (unknown)>(1): displays buffer <buffer 0>; cursor is at (1, 0)
diff --git a/src/testdir/test87.in b/src/testdir/test87.in
index 69af02e..95ae027 100644
--- a/src/testdir/test87.in
+++ b/src/testdir/test87.in
@@ -561,18 +561,26 @@
:vnew b.2
:vnew c.2
py3 << EOF
+cb.append('Number of tabs: ' + str(len(vim.tabpages)))
+cb.append('Current tab pages:')
+
def W(w):
if '(unknown)' in repr(w):
return '<window object (unknown)>'
else:
return repr(w)
-cb.append('Number of tabs: ' + str(len(vim.tabpages)))
-cb.append('Current tab pages:')
+
+def Cursor(w, start=len(cb)):
+ if w.buffer is cb:
+ return repr((start - w.cursor[0], w.cursor[1]))
+ else:
+ return repr(w.cursor)
+
for t in vim.tabpages:
cb.append(' ' + repr(t) + '(' + str(t.number) + ')' + ': ' + str(len(t.windows)) + ' windows, current is ' + W(t.window))
cb.append(' Windows:')
for w in t.windows:
- cb.append(' ' + W(w) + '(' + str(w.number) + ')' + ': displays buffer ' + repr(w.buffer) + '; cursor is at ' + repr(w.cursor))
+ cb.append(' ' + W(w) + '(' + str(w.number) + ')' + ': displays buffer ' + repr(w.buffer) + '; cursor is at ' + Cursor(w))
# Other values depend on the size of the terminal, so they are checked partly:
for attr in ('height', 'row', 'width', 'col'):
try:
diff --git a/src/testdir/test87.ok b/src/testdir/test87.ok
index 64ef57d..77548d5 100644
--- a/src/testdir/test87.ok
+++ b/src/testdir/test87.ok
@@ -322,7 +322,7 @@
Current tab pages:
<tabpage 0>(1): 1 windows, current is <window object (unknown)>
Windows:
- <window object (unknown)>(1): displays buffer <buffer test87.in>; cursor is at (966, 0)
+ <window object (unknown)>(1): displays buffer <buffer test87.in>; cursor is at (27, 0)
<tabpage 1>(2): 1 windows, current is <window object (unknown)>
Windows:
<window object (unknown)>(1): displays buffer <buffer 0>; cursor is at (1, 0)