Lispython / human_curl

Simple Human wrapper for cURL library
http://h.wrttn.me/human_curl
Other
205 stars 43 forks source link

Tried to fix ValueError: signal only works in main thread #30

Closed wreckah closed 10 years ago

wreckah commented 10 years ago

I got the error when I was working in threads:

  File "/usr/local/lib/python2.7/dist-packages/human_curl/__init__.py", line 55, in <module>
    from .methods import get, put, head, post, delete, request, options
  File "/usr/local/lib/python2.7/dist-packages/human_curl/methods.py", line 12, in <module>
    from .core import Request
  File "/usr/local/lib/python2.7/dist-packages/human_curl/core.py", line 46, in <module>
    signal.signal(signal.SIGPIPE, signal.SIG_IGN)
ValueError: signal only works in main thread

So I tried to solve it. I'm not sure that my fix is absolutely correct but it works for me.