Commit 504f334c authored by Vincent Michel's avatar Vincent Michel
Browse files

Fix gevent patch

parent d040c8d5
......@@ -10,7 +10,7 @@ from __future__ import absolute_import
from functools import wraps
from gevent import threadpool
from .interface import handel
from . import interface
# Green pool
......@@ -41,7 +41,12 @@ def patch():
>>> from handel.gevent import patch
>>> patch()
for name in dir(handel):
# Gevent-compatible version of handel FFI library
gevent_handel = type('GeventFFILibrary', (), {})()
# Populate gevent_handel
for name in dir(interface.handel):
if name.startswith('xia'):
func = getattr(handel, name)
setattr(handel, name, green(func))
func = getattr(interface.handel, name)
setattr(gevent_handel, name, green(func))
# Patch
interface.handel = gevent_handel
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment