diff options
| author | Stefan Behnel <stefan_ml@behnel.de> | 2018-10-24 21:16:26 +0200 |
|---|---|---|
| committer | Stefan Behnel <stefan_ml@behnel.de> | 2018-10-24 21:16:26 +0200 |
| commit | 68cf93c4827ea74e46d2aa6809011f96ed9c689a (patch) | |
| tree | ddcebe1bef1ae5cc868414b828590183b9b9f5e8 /src/lxml | |
| parent | d5c69a40df483ed60e75ebcb27e493c51e10873d (diff) | |
| download | python-lxml-68cf93c4827ea74e46d2aa6809011f96ed9c689a.tar.gz | |
LP#1799755: Fix ABC imports from collections package to resolve a DeprecationWarning in Py3.7.
Diffstat (limited to 'src/lxml')
| -rw-r--r-- | src/lxml/html/__init__.py | 1 | ||||
| -rw-r--r-- | src/lxml/html/_setmixin.py | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/lxml/html/__init__.py b/src/lxml/html/__init__.py index 4502373e..5751f709 100644 --- a/src/lxml/html/__init__.py +++ b/src/lxml/html/__init__.py @@ -46,7 +46,6 @@ import re from functools import partial try: - # while unnecessary, importing from 'collections.abc' is the right way to do it from collections.abc import MutableMapping, MutableSet except ImportError: from collections import MutableMapping, MutableSet diff --git a/src/lxml/html/_setmixin.py b/src/lxml/html/_setmixin.py index c14a3eb0..c99738e3 100644 --- a/src/lxml/html/_setmixin.py +++ b/src/lxml/html/_setmixin.py @@ -1,4 +1,8 @@ -from collections import MutableSet +try: + from collections.abc import MutableSet +except ImportError: + from collections import MutableSet + class SetMixin(MutableSet): |
