[pypy-svn] r23455 - in pypy/dist/pypy/module: stackless thread
nik at codespeak.net
nik at codespeak.net
Fri Feb 17 16:51:19 CET 2006
Author: nik
Date: Fri Feb 17 16:51:18 2006
New Revision: 23455
Modified:
pypy/dist/pypy/module/stackless/interp_coroutine.py
pypy/dist/pypy/module/thread/os_thread.py
Log:
use new callable helper where appropriate.
Modified: pypy/dist/pypy/module/stackless/interp_coroutine.py
==============================================================================
--- pypy/dist/pypy/module/stackless/interp_coroutine.py (original)
+++ pypy/dist/pypy/module/stackless/interp_coroutine.py Fri Feb 17 16:51:18 2006
@@ -202,7 +202,7 @@
def __init__(self, space, costate, w_obj, args):
self.space = space
self.costate = costate
- if space.lookup(w_obj, '__call__') is None:
+ if not space.callable(w_obj):
raise OperationError(
space.w_TypeError,
space.mod(space.wrap('object %r is not callable'),
Modified: pypy/dist/pypy/module/thread/os_thread.py
==============================================================================
--- pypy/dist/pypy/module/thread/os_thread.py (original)
+++ pypy/dist/pypy/module/thread/os_thread.py Fri Feb 17 16:51:18 2006
@@ -63,8 +63,7 @@
if w_kwargs is not None and not space.is_true(space.isinstance(w_kwargs, space.w_dict)):
raise OperationError(space.w_TypeError,
space.wrap("optional 3rd arg must be a dictionary"))
- # XXX using space.lookup here is not very nice
- if space.lookup(w_callable, "__call__") is None:
+ if not space.is_true(space.callable(w_callable)):
raise OperationError(space.w_TypeError,
space.wrap("first arg must be callable"))
More information about the Pypy-commit
mailing list