From f8e39f91ad757f79cd4f83d481fabf627699f78f Mon Sep 17 00:00:00 2001 From: Sylvain Th?nault Date: Mon, 29 Apr 2013 15:58:38 +0200 Subject: [registry] type.__new__ first arg is the metaclass, not the class --- registry.py | 4 ++-- 1 file 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 -- cgit v1.2.1