Skip to content

Commit ebd12d8

Browse files
committed
Move MutableMapping import into compat.py
1 parent 8b84cbe commit ebd12d8

4 files changed

Lines changed: 9 additions & 17 deletions

File tree

botocore/awsrequest.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,9 @@
2525
import botocore.utils
2626
from botocore.compat import six
2727
from botocore.compat import HTTPHeaders, HTTPResponse, urlunsplit, urlsplit, \
28-
urlencode
28+
urlencode, MutableMapping
2929
from botocore.exceptions import UnseekableStreamError
3030

31-
try:
32-
from collections.abc import MutableMapping
33-
except ImportError:
34-
from collections import MutableMapping
35-
3631

3732
logger = logging.getLogger(__name__)
3833

botocore/compat.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,3 +377,9 @@ def _windows_shell_split(s):
377377
components.append(''.join(buff))
378378

379379
return components
380+
381+
382+
try:
383+
from collections.abc import MutableMapping
384+
except ImportError:
385+
from collections import MutableMapping

botocore/session.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,7 @@
4848
from botocore import retryhandler, translate
4949
from botocore import utils
5050
from botocore.utils import EVENT_ALIASES
51-
52-
try:
53-
from collections.abc import MutableMapping
54-
except ImportError:
55-
from collections import MutableMapping
51+
from botocore.compat import MutableMapping
5652

5753

5854
logger = logging.getLogger(__name__)

tests/unit/test_parsers.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,7 @@
1818

1919
from botocore import parsers
2020
from botocore import model
21-
from botocore.compat import json
22-
23-
try:
24-
from collections.abc import MutableMapping
25-
except ImportError:
26-
from collections import MutableMapping
21+
from botocore.compat import json, MutableMapping
2722

2823

2924
# HTTP responses will typically return a custom HTTP

0 commit comments

Comments
 (0)