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 collections.abc imports for Python 3.9 #4860

Merged
merged 2 commits into from
Feb 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 0 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,16 @@ matrix:
include:
- python: 2.7
dist: trusty
sudo: false
- python: 3.4
dist: trusty
sudo: false
- python: 3.5
dist: trusty
sudo: false
- python: 3.6
dist: trusty
sudo: false
- python: 3.7
dist: xenial
sudo: true
- python: 3.8
dist: xenial
sudo: true

before_install:
- if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
Expand Down
4 changes: 2 additions & 2 deletions awscli/customizations/history/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import datetime
import threading
import logging
from collections import MutableMapping
from awscli.compat import collections_abc

from botocore.history import BaseHistoryHandler

Expand Down Expand Up @@ -119,7 +119,7 @@ def encode(self, obj):
def default(self, obj):
if isinstance(obj, datetime.datetime):
return self._encode_datetime(obj)
elif isinstance(obj, MutableMapping):
elif isinstance(obj, collections_abc.MutableMapping):
return self._encode_mutable_mapping(obj)
elif isinstance(obj, binary_type):
# In PY3 the bytes type differs from the str type so the default
Expand Down
7 changes: 3 additions & 4 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from collections import MutableMapping
from collections import Mapping
from awscli.compat import collections_abc


# CaseInsensitiveDict from requests that must be serializble.
class CaseInsensitiveDict(MutableMapping):
class CaseInsensitiveDict(collections_abc.MutableMapping):
def __init__(self, data=None, **kwargs):
self._store = dict()
if data is None:
Expand Down Expand Up @@ -36,7 +35,7 @@ def lower_items(self):
)

def __eq__(self, other):
if isinstance(other, Mapping):
if isinstance(other, collections_abc.Mapping):
other = CaseInsensitiveDict(other)
else:
return NotImplemented
Expand Down