updated for version 7.3.808
Problem: Python threads still do not work properly.
Solution: Fix both Python 2 and 3. Add tests. (Ken Takata)
diff --git a/src/testdir/test86.in b/src/testdir/test86.in
index 1309643..71635bd 100644
--- a/src/testdir/test86.in
+++ b/src/testdir/test86.in
@@ -267,6 +267,54 @@
: $put =toput
: endtry
:endfor
+:"
+:" threading
+:let l = [0]
+:py l=vim.bindeval('l')
+:py <<EOF
+import threading
+import time
+
+class T(threading.Thread):
+ def __init__(self):
+ threading.Thread.__init__(self)
+ self.t = 0
+ self.running = True
+
+ def run(self):
+ while self.running:
+ self.t += 1
+ time.sleep(0.1)
+
+t = T()
+t.start()
+EOF
+:sleep 1
+:py t.running = False
+:py t.join()
+:py l[0] = t.t > 8 # check if the background thread is working
+:$put =string(l)
+:"
+:" settrace
+:let l = []
+:py l=vim.bindeval('l')
+:py <<EOF
+import sys
+
+def traceit(frame, event, arg):
+ global l
+ if event == "line":
+ l.extend([frame.f_lineno])
+ return traceit
+
+def trace_main():
+ for i in range(5):
+ pass
+EOF
+:py sys.settrace(traceit)
+:py trace_main()
+:py sys.settrace(None)
+:$put =string(l)
:endfun
:"
:call Test()