diff options
-rw-r--r-- | raven/breadcrumbs.py | 8 | ||||
-rw-r--r-- | raven/context.py | 6 |
2 files changed, 11 insertions, 3 deletions
diff --git a/raven/breadcrumbs.py b/raven/breadcrumbs.py index fbf3026..99ff013 100644 --- a/raven/breadcrumbs.py +++ b/raven/breadcrumbs.py @@ -1,9 +1,13 @@ from __future__ import absolute_import -import collections import os import logging +try: + from collections.abc import Mapping +except ImportError: + # Python < 3.3 + from collections import Mapping from time import time from types import FunctionType @@ -140,7 +144,7 @@ def _record_log_breadcrumb(logger, level, msg, *args, **kwargs): data_value = kwargs data_value.update(extra) - if args and len(args) == 1 and isinstance(args[0], collections.Mapping) and args[0]: + if args and len(args) == 1 and isinstance(args[0], Mapping) and args[0]: format_args = args[0] data_value.update(format_args) diff --git a/raven/context.py b/raven/context.py index 272259a..072be93 100644 --- a/raven/context.py +++ b/raven/context.py @@ -7,7 +7,11 @@ raven.context """ from __future__ import absolute_import -from collections import Mapping, Iterable +try: + from collections.abc import Mapping, Iterable +except ImportError: + # Python < 3.3 + from collections import Mapping, Iterable from threading import local from weakref import ref as weakref |