From 8d7683e56362f734da556073e45021f6edc1bf06 Mon Sep 17 00:00:00 2001 From: Brandon Konkle Date: Wed, 15 Jun 2011 18:05:27 -0700 Subject: Provide the class name explicitly to super() to prevent infinite loops when SQLDebugPanel is subclassed. --- debug_toolbar/panels/sql.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debug_toolbar') diff --git a/debug_toolbar/panels/sql.py b/debug_toolbar/panels/sql.py index c6e73a0..e95f127 100644 --- a/debug_toolbar/panels/sql.py +++ b/debug_toolbar/panels/sql.py @@ -219,7 +219,7 @@ class SQLDebugPanel(DebugPanel): has_content = True def __init__(self, *args, **kwargs): - super(self.__class__, self).__init__(*args, **kwargs) + super(SQLDebugPanel, self).__init__(*args, **kwargs) self._offset = dict((conn, len(connections[conn].queries)) for conn in connections) self._sql_time = 0 self._queries = [] -- cgit v1.2.3 From 75baac10c7f5eba4252c5fda116c318c435b4bae Mon Sep 17 00:00:00 2001 From: Brandon Konkle Date: Wed, 15 Jun 2011 18:27:01 -0700 Subject: Refer to the class explicitly instead of using self.__class__ to eliminate problems with subclasses. --- debug_toolbar/panels/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debug_toolbar') diff --git a/debug_toolbar/panels/cache.py b/debug_toolbar/panels/cache.py index 5617ec2..0562bef 100644 --- a/debug_toolbar/panels/cache.py +++ b/debug_toolbar/panels/cache.py @@ -77,7 +77,7 @@ class CacheDebugPanel(DebugPanel): has_content = True def __init__(self, *args, **kwargs): - super(self.__class__, self).__init__(*args, **kwargs) + super(CacheDebugPanel, self).__init__(*args, **kwargs) # This is hackish but to prevent threading issues is somewhat needed if isinstance(cache.cache, CacheStatTracker): cache.cache.reset() -- cgit v1.2.3