Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix deprecation warnings for collections.abc (will break in Python 3.9) #1865

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions botocore/awsrequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import logging
import functools
import socket
import collections

import urllib3.util
from urllib3.connection import VerifiedHTTPSConnection
Expand All @@ -29,6 +28,11 @@
urlencode
from botocore.exceptions import UnseekableStreamError

try:
from collections.abc import MutableMapping
except ImportError:
from collections import MutableMapping


logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -621,7 +625,7 @@ def __repr__(self):
return repr(self._key)


class HeadersDict(collections.MutableMapping):
class HeadersDict(MutableMapping):
"""A case-insenseitive dictionary to represent HTTP headers. """
def __init__(self, *args, **kwargs):
self._dict = {}
Expand Down
8 changes: 6 additions & 2 deletions botocore/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import platform
import socket
import warnings
import collections

from botocore import __version__
from botocore import UNSIGNED
Expand Down Expand Up @@ -50,6 +49,11 @@
from botocore import utils
from botocore.utils import EVENT_ALIASES

try:
from collections.abc import MutableMapping
except ImportError:
from collections import MutableMapping


logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -944,7 +948,7 @@ def lazy_register_component(self, name, no_arg_factory):
pass


class SessionVarDict(collections.MutableMapping):
class SessionVarDict(MutableMapping):
def __init__(self, session, session_vars):
self._session = session
self._store = copy.copy(session_vars)
Expand Down