diff options
| author | Aymeric Augustin | 2013-10-16 22:43:30 +0200 | 
|---|---|---|
| committer | Aymeric Augustin | 2013-10-17 18:24:57 +0200 | 
| commit | 820161dea57316e177f0bf05741fd510f53df5d3 (patch) | |
| tree | 90f7aad68198885fbe7694d972b002f63220777e | |
| parent | a5d97931033a142a65d6ccdd06b5d345f535513d (diff) | |
| download | django-debug-toolbar-820161dea57316e177f0bf05741fd510f53df5d3.tar.bz2 | |
Avoid naked except clauses.
| -rw-r--r-- | debug_toolbar/panels/cache.py | 2 | ||||
| -rw-r--r-- | debug_toolbar/toolbar/loader.py | 5 | ||||
| -rw-r--r-- | debug_toolbar/utils/tracking/db.py | 2 | ||||
| -rw-r--r-- | debug_toolbar/views.py | 2 | 
4 files changed, 4 insertions, 7 deletions
| diff --git a/debug_toolbar/panels/cache.py b/debug_toolbar/panels/cache.py index e25f08b..852327d 100644 --- a/debug_toolbar/panels/cache.py +++ b/debug_toolbar/panels/cache.py @@ -42,7 +42,7 @@ def send_signal(method):                          template_info = get_template_info(node.source)                          break                  cur_frame = cur_frame.f_back -        except: +        except Exception:              pass          del cur_frame          cache_called.send(sender=self.__class__, time_taken=t, diff --git a/debug_toolbar/toolbar/loader.py b/debug_toolbar/toolbar/loader.py index f26d814..5f01aa7 100644 --- a/debug_toolbar/toolbar/loader.py +++ b/debug_toolbar/toolbar/loader.py @@ -42,10 +42,7 @@ class DebugToolbar(object):          """          global panel_classes          for panel_class in panel_classes: -            try: -                panel_instance = panel_class(context=self.template_context) -            except: -                raise  # Bubble up problem loading panel +            panel_instance = panel_class(context=self.template_context)              self._panels[panel_class] = panel_instance diff --git a/debug_toolbar/utils/tracking/db.py b/debug_toolbar/utils/tracking/db.py index 8c728b4..a9c36dc 100644 --- a/debug_toolbar/utils/tracking/db.py +++ b/debug_toolbar/utils/tracking/db.py @@ -119,7 +119,7 @@ class NormalCursorWrapper(object):                              template_info = get_template_info(node.source)                              break                      cur_frame = cur_frame.f_back -            except: +            except Exception:                  pass              del cur_frame diff --git a/debug_toolbar/views.py b/debug_toolbar/views.py index ab91cde..045e5cc 100644 --- a/debug_toolbar/views.py +++ b/debug_toolbar/views.py @@ -92,7 +92,7 @@ def sql_profile(request):              cursor.execute("SELECT * FROM information_schema.profiling WHERE query_id=(SELECT query_id FROM information_schema.profiling ORDER BY query_id DESC LIMIT 1)")              headers = [d[0] for d in cursor.description]              result = cursor.fetchall() -        except: +        except Exception:              result_error = "Profiling is either not available or not supported by your database."          cursor.close()          context = { | 
