From 91fe7e0ca70a38c25fb3dfa53a574e1419f8a0d9 Mon Sep 17 00:00:00 2001 From: James Lu Date: Tue, 27 Jun 2017 16:25:40 -0700 Subject: [PATCH] utils.CC2SC: use self.__class__ to get the name of the current subclass This is the intended behaviour instead of showing "CamelCaseToSnakeCase" in attribute errors. --- utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.py b/utils.py index 22c65ca..f519a3c 100644 --- a/utils.py +++ b/utils.py @@ -627,6 +627,6 @@ class CamelCaseToSnakeCase(): if normalized_attr == attr: # __getattr__ only fires if normal attribute fetching fails, so we can assume that # the attribute was tried already and failed. - raise AttributeError('%s object has no attribute of normalized name %r' % (__class__.__name__, attr)) + raise AttributeError('%s object has no attribute of normalized name %r' % (self.__class__.__name__, attr)) return getattr(self, normalized_attr)