Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
chore(deprecation): fix collections.abc imports
Browse files Browse the repository at this point in the history
As of Python 3.7, importing ABCs directly from collections has been
deprecated.

> DeprecationWarning: Using or importing the ABCs from 'collections'
> instead of from 'collections.abc' is deprecated, and in 3.8 it
> will stop working.
  • Loading branch information
TheKevJames authored and ashwoods committed Sep 14, 2018
1 parent 97b7d56 commit c4403f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions raven/breadcrumbs.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -140,7 +144,7 @@ def processor(data):
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)

Expand Down
6 changes: 5 additions & 1 deletion raven/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
"""
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

Expand Down

0 comments on commit c4403f2

Please sign in to comment.