diff options
| author | Aymeric Augustin | 2013-10-16 23:17:59 +0200 |
|---|---|---|
| committer | Aymeric Augustin | 2013-10-17 18:24:58 +0200 |
| commit | dc19b418a258bf7d7cabebfe83690b5b0291f60f (patch) | |
| tree | 0b00913aa6d1fc23b797717002bcf9c20123db27 /debug_toolbar/panels | |
| parent | 87a73758431a417f6f1aa7313260e1049549f713 (diff) | |
| download | django-debug-toolbar-dc19b418a258bf7d7cabebfe83690b5b0291f60f.tar.bz2 | |
Stopped using dict.iter*.
Since performance isn't a primary concern, the non-iterable versions
will do just fine on Python 2.
Diffstat (limited to 'debug_toolbar/panels')
| -rw-r--r-- | debug_toolbar/panels/cache.py | 2 | ||||
| -rw-r--r-- | debug_toolbar/panels/profiling.py | 4 | ||||
| -rw-r--r-- | debug_toolbar/panels/request_vars.py | 2 | ||||
| -rw-r--r-- | debug_toolbar/panels/sql.py | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/debug_toolbar/panels/cache.py b/debug_toolbar/panels/cache.py index 80a3b46..1272dfc 100644 --- a/debug_toolbar/panels/cache.py +++ b/debug_toolbar/panels/cache.py @@ -168,7 +168,7 @@ class CacheDebugPanel(DebugPanel): else: self.hits += 1 elif name == 'get_many': - for key, value in return_value.iteritems(): + for key, value in return_value.items(): if value is None: self.misses += 1 else: diff --git a/debug_toolbar/panels/profiling.py b/debug_toolbar/panels/profiling.py index 6adb279..f71472b 100644 --- a/debug_toolbar/panels/profiling.py +++ b/debug_toolbar/panels/profiling.py @@ -23,7 +23,7 @@ class DjangoDebugToolbarStats(Stats): def get_root_func(self): if self.__root is None: - for func, (cc, nc, tt, ct, callers) in self.stats.iteritems(): + for func, (cc, nc, tt, ct, callers) in self.stats.items(): if len(callers) == 0: self.__root = func break @@ -80,7 +80,7 @@ class FunctionCall(object): i = 0 h, s, v = self.hsv count = len(self.statobj.all_callees[self.func]) - for func, stats in self.statobj.all_callees[self.func].iteritems(): + for func, stats in self.statobj.all_callees[self.func].items(): i += 1 h1 = h + (i / count) / (self.depth + 1) if stats[3] == 0: diff --git a/debug_toolbar/panels/request_vars.py b/debug_toolbar/panels/request_vars.py index 936c964..5bf3e7f 100644 --- a/debug_toolbar/panels/request_vars.py +++ b/debug_toolbar/panels/request_vars.py @@ -55,5 +55,5 @@ class RequestVarsDebugPanel(DebugPanel): if hasattr(self.request, 'session'): self.record_stats({ 'session': [(k, self.request.session.get(k)) - for k in self.request.session.iterkeys()] + for k in self.request.session.keys()] }) diff --git a/debug_toolbar/panels/sql.py b/debug_toolbar/panels/sql.py index 7afc6eb..bc70b97 100644 --- a/debug_toolbar/panels/sql.py +++ b/debug_toolbar/panels/sql.py @@ -139,7 +139,7 @@ class SQLDebugPanel(DebugPanel): if self._queries: width_ratio_tally = 0 factor = int(256.0 / (len(self._databases) * 2.5)) - for n, db in enumerate(self._databases.itervalues()): + for n, db in enumerate(self._databases.values()): rgb = [0, 0, 0] color = n % 3 rgb[color] = 256 - n / 3 * factor |
