diff options
author | Raymond Hettinger <raymond.hettinger@gmail.com> | 2018-02-04 23:27:20 -0800 |
---|---|---|
committer | Raymond Hettinger <raymond.hettinger@gmail.com> | 2018-02-04 23:27:20 -0800 |
commit | 82c444d24024aebe63dd25e585fd1d8176a9d44f (patch) | |
tree | dbf3469df392e4d112d0cc53e9ff1fb6262a054a | |
parent | d9898fb39e6c6037dea12d7226813d35b40f0947 (diff) | |
download | urllib3-82c444d24024aebe63dd25e585fd1d8176a9d44f.tar.gz |
Separate collections from collections.abc
-rw-r--r-- | urllib3/_collections.py | 5 | ||||
-rw-r--r-- | urllib3/util/selectors.py | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/urllib3/_collections.py b/urllib3/_collections.py index 1dabbfa8..6e36b84e 100644 --- a/urllib3/_collections.py +++ b/urllib3/_collections.py @@ -1,5 +1,8 @@ from __future__ import absolute_import -from collections import Mapping, MutableMapping +try: + from collections.abc import Mapping, MutableMapping +except ImportError: + from collections import Mapping, MutableMapping try: from threading import RLock except ImportError: # Platform-specific: No threads available diff --git a/urllib3/util/selectors.py b/urllib3/util/selectors.py index 57334473..5cb772f6 100644 --- a/urllib3/util/selectors.py +++ b/urllib3/util/selectors.py @@ -11,10 +11,15 @@ import select import socket import sys import time -from collections import namedtuple, Mapping +from collections import namedtuple from ..packages.six import integer_types try: + from collections.abc import Mapping +except ImportError: + from collections import Mapping + +try: monotonic = time.monotonic except (AttributeError, ImportError): # Python 3.3< monotonic = time.time |