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 | 71919ff169ab137bcc0d6df776046ac8ccc54595 (patch) | |
tree | f7021c65b3eb279143f68882fd30ee91ef2267ea | |
parent | 9d91c1e602dcffa2a4b08c69a33f7ef4e75bde46 (diff) | |
download | python-lxml-71919ff169ab137bcc0d6df776046ac8ccc54595.tar.gz |
LP#1799755: Fix ABC imports from collections package to resolve a DeprecationWarning in Py3.7.
-rw-r--r-- | CHANGES.txt | 5 | ||||
-rw-r--r-- | src/lxml/html/__init__.py | 1 | ||||
-rw-r--r-- | src/lxml/html/_setmixin.py | 6 |
3 files changed, 10 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index d9b2bf49..a13feeb6 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -10,6 +10,11 @@ Bugs fixed * Import warnings in Python 3.6+ were resolved. +Bugs fixed +---------- + +* LP#1799755: Fix a DeprecationWarning in Py3.7+. + 4.2.5 (2018-09-09) ================== 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): |