diff options
| author | Bouke Haarsma <bouke@webatoom.nl> | 2013-11-20 18:50:36 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2013-11-22 20:37:09 +0100 |
| commit | d55df0b81083d8aa02145ac5885a855a9c9577b3 (patch) | |
| tree | 6cafd66edd258046618da04b945a83ea1baa72ec /django | |
| parent | ea0d97c470ca2d5ddb4320fe03c77221b3064adf (diff) | |
[1.6.x] Fixed #21443 -- Cannot show debug info on PY3's importlib
Thanks productions@zaziork.co.uk for the review.
Backport of 18185724e6 from master.
Diffstat (limited to 'django')
| -rw-r--r-- | django/views/debug.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/django/views/debug.py b/django/views/debug.py index 21e2eac06b..b723b9dcc5 100644 --- a/django/views/debug.py +++ b/django/views/debug.py @@ -376,7 +376,10 @@ class ExceptionReporter(object): """ source = None if loader is not None and hasattr(loader, "get_source"): - source = loader.get_source(module_name) + try: + source = loader.get_source(module_name) + except ImportError: + pass if source is not None: source = source.splitlines() if source is None: |
