Commit d1d8048a authored by Jeremy Hylton's avatar Jeremy Hylton

Get rid of the apply() calls now.

parent d0ff628e
...@@ -25,7 +25,7 @@ register_loop_callback() to register interest. When the mainloop ...@@ -25,7 +25,7 @@ register_loop_callback() to register interest. When the mainloop
thread calls loop(), each registered callback will be called with the thread calls loop(), each registered callback will be called with the
socket map as its first argument. socket map as its first argument.
""" """
__version__ = '$Revision: 1.11 $'[11:-2] __version__ = '$Revision: 1.12 $'[11:-2]
import asyncore import asyncore
import select import select
...@@ -62,7 +62,7 @@ def register_loop_callback(callback, args=(), kw=None): ...@@ -62,7 +62,7 @@ def register_loop_callback(callback, args=(), kw=None):
_loop_lock.acquire() _loop_lock.acquire()
try: try:
if _looping is not None: if _looping is not None:
apply(callback, (_looping,) + args, kw or {}) callback(_looping, *args, **(kw or {}))
else: else:
_loop_callbacks.append((callback, args, kw)) _loop_callbacks.append((callback, args, kw))
finally: finally:
...@@ -85,7 +85,7 @@ def _start_loop(map): ...@@ -85,7 +85,7 @@ def _start_loop(map):
_looping = map _looping = map
while _loop_callbacks: while _loop_callbacks:
cb, args, kw = _loop_callbacks.pop() cb, args, kw = _loop_callbacks.pop()
apply(cb, (map,) + args, kw or {}) cb(map, *args, **(kw or {}))
finally: finally:
_loop_lock.release() _loop_lock.release()
......
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