Commit 36c29081 authored by Denis Bilenko's avatar Denis Bilenko

fix for the last fix: set arg properly in wait_write and wait_readwrite. Patch by Ralf Schmitt.

parent 1e80a425
......@@ -171,6 +171,7 @@ def wait_write(fileno, timeout=-1, timeout_exc=_socket.timeout('timed out'), eve
else:
assert event.callback == _wait_helper, event.callback
assert event.arg is None, 'This event is already used by another greenlet: %r' % (event.arg, )
event.arg = (getcurrent(), timeout_exc)
event.add(timeout)
try:
switch_result = get_hub().switch()
......@@ -192,6 +193,7 @@ def wait_readwrite(fileno, timeout=-1, timeout_exc=_socket.timeout('timed out'),
else:
assert event.callback == _wait_helper, event.callback
assert event.arg is None, 'This event is already used by another greenlet: %r' % (event.arg, )
event.arg = (getcurrent(), timeout_exc)
event.add(timeout)
try:
switch_result = get_hub().switch()
......
Markdown is supported
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