Skip to content

Commit

Permalink
Merge pull request #4860 from hugovk/fix-py39
Browse files Browse the repository at this point in the history
Fix collections.abc imports for Python 3.9
  • Loading branch information
joguSD authored Feb 11, 2020
2 parents 238c306 + 0c9c088 commit 876e704
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
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

0 comments on commit 876e704

Please sign in to comment.