[pypy-svn] r78774 - in pypy/branch/fast-forward/pypy/module/thread: . test
afa at codespeak.net
afa at codespeak.net
Fri Nov 5 23:14:52 CET 2010
Author: afa
Date: Fri Nov 5 23:14:51 2010
New Revision: 78774
Modified:
pypy/branch/fast-forward/pypy/module/thread/os_local.py
pypy/branch/fast-forward/pypy/module/thread/test/test_local.py
Log:
thread._local.__init__ accepts no argument.
Modified: pypy/branch/fast-forward/pypy/module/thread/os_local.py
==============================================================================
--- pypy/branch/fast-forward/pypy/module/thread/os_local.py (original)
+++ pypy/branch/fast-forward/pypy/module/thread/os_local.py Fri Nov 5 23:14:51 2010
@@ -47,15 +47,20 @@
self.dicts[ident] = w_dict
def descr_local__new__(space, w_subtype, __args__):
- # XXX check __args__
local = space.allocate_instance(Local, w_subtype)
Local.__init__(local, space, __args__)
return space.wrap(local)
+ descr_local__new__.unwrap_spec=[ObjSpace, W_Root, Arguments]
+
+ def descr_local__init__(self, space):
+ # No arguments allowed
+ pass
+ descr_local__init__.unwrap_spec=['self', ObjSpace]
Local.typedef = TypeDef("thread._local",
__doc__ = "Thread-local data",
- __new__ = interp2app(Local.descr_local__new__.im_func,
- unwrap_spec=[ObjSpace, W_Root, Arguments]),
+ __new__ = interp2app(Local.descr_local__new__.im_func),
+ __init__ = interp2app(Local.descr_local__init__),
__dict__ = GetSetProperty(descr_get_dict,
descr_set_dict, cls=Local),
)
Modified: pypy/branch/fast-forward/pypy/module/thread/test/test_local.py
==============================================================================
--- pypy/branch/fast-forward/pypy/module/thread/test/test_local.py (original)
+++ pypy/branch/fast-forward/pypy/module/thread/test/test_local.py Fri Nov 5 23:14:51 2010
@@ -51,6 +51,9 @@
tags = [1, 2, 3, 4, 5, 54321]
seen = []
+ raises(TypeError, thread._local, a=1)
+ raises(TypeError, thread._local, 1)
+
class X(thread._local):
def __init__(self, n):
assert n == 42
More information about the Pypy-commit
mailing list