From 7230708f6f82dffc1f029505f2a4a9c3a9e815c0 Mon Sep 17 00:00:00 2001 From: scryver Date: Fri, 30 Dec 2016 10:44:03 +0100 Subject: [PATCH] Update utils.py (#455) Name that thing should not use a metaclass to name a thing. --- channels/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels/utils.py b/channels/utils.py index 423f61f..a22ba20 100644 --- a/channels/utils.py +++ b/channels/utils.py @@ -14,7 +14,7 @@ def name_that_thing(thing): # Other named thing if hasattr(thing, "__name__"): if hasattr(thing, "__class__") and not isinstance(thing, (types.FunctionType, types.MethodType)): - if thing.__class__ is not type: + if thing.__class__ is not type and not issubclass(thing.__class__, type): return name_that_thing(thing.__class__) if hasattr(thing, "__self__"): return "%s.%s" % (thing.__self__.__module__, thing.__self__.__name__)