1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

Fixed #21443 -- Cannot show debug info on PY3's importlib

Thanks productions@zaziork.co.uk for the review.
This commit is contained in:
Bouke Haarsma
2013-11-20 18:50:36 +01:00
committed by Claude Paroz
parent 47afe07324
commit 18185724e6
2 changed files with 20 additions and 1 deletions

View File

@@ -388,7 +388,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: