summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Th?nault <sylvain.thenault@logilab.fr>2013-04-29 15:58:38 +0200
committerSylvain Th?nault <sylvain.thenault@logilab.fr>2013-04-29 15:58:38 +0200
commitf8e39f91ad757f79cd4f83d481fabf627699f78f (patch)
treeb9174308e37a20735eb2cfce475497c9c1b4d9bf
parent4177db3d468dec0d363071f16e52da25b52be95b (diff)
downloadlogilab-common-f8e39f91ad757f79cd4f83d481fabf627699f78f.tar.gz
[registry] type.__new__ first arg is the metaclass, not the class
-rw-r--r--registry.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/registry.py b/registry.py
index 0dc7a21..7721d76 100644
--- a/registry.py
+++ b/registry.py
@@ -933,9 +933,9 @@ def wrap_predicates(decorator):
predicate.__call__ = decorator(predicate.__call__)
class PredicateMetaClass(type):
- def __new__(cls, *args, **kwargs):
+ def __new__(mcs, *args, **kwargs):
# use __new__ so subclasses doesn't have to call Predicate.__init__
- inst = type.__new__(cls, *args, **kwargs)
+ inst = type.__new__(mcs, *args, **kwargs)
proxy = weakref.proxy(inst, lambda p: _PREDICATES.pop(id(p)))
_PREDICATES[id(proxy)] = proxy
return inst