summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/timezone.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/django/utils/timezone.py b/django/utils/timezone.py
index 70fd5e3e48..205cac44a9 100644
--- a/django/utils/timezone.py
+++ b/django/utils/timezone.py
@@ -146,6 +146,8 @@ class LocalTimezone(ReferenceLocalTimezone):
exc_value = exc_type(
"Unsupported value: %r. You should install pytz." % dt)
exc_value.__cause__ = exc
+ if not hasattr(exc, '__traceback__'):
+ exc.__traceback__ = sys.exc_info()[2]
six.reraise(exc_type, exc_value, sys.exc_info()[2])
utc = pytz.utc if pytz else UTC()