1

I've compiled Python 2.7.10 and Vim 7.4 with Python support (HP-UX 11.31 ia64). Everything seems to be working well except for threads. Here's simple example.

from threading import Thread
from time import sleep

def threaded_function(arg):
    for i in range(arg):
        print i
        sleep(1)

def start_thread():
    thread = Thread(target = threaded_function, args=(5, ))
    thread.start()

if __name__ == '__main__':
    start_thread()

Python interpreter executes it perfectly well.

% python thread.py
0
1
2
3
4

But Vim produces an error when I'm trying to source it (enclosed in python << EOF / EOF brackets):

Traceback (most recent call last):
  File "<string>", line 14, in <module>
  File "<string>", line 11, in start_thread
  File "/home/users/zemtsoe/local/lib/python2.7/threading.py", line 745, in start
    _start_new_thread(self.__bootstrap, ())
thread.error: can't start new thread

AFAIK Python threads are available (despite Vim thread-unsafety). Also I'm unable to use YCM plugin because of this error. What can I do?

Luc Hermitte
  • 31,979
  • 7
  • 69
  • 83

0 Answers0