From be611d9a84a790f156776cce3382ef9510f02311 Mon Sep 17 00:00:00 2001 From: Javier Caballero Date: Fri, 13 Dec 2019 11:41:33 +0100 Subject: [PATCH] Fix collections ABCs deprecation warning DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working from collections import Mapping --- bleach/_vendor/html5lib/_trie/_base.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bleach/_vendor/html5lib/_trie/_base.py b/bleach/_vendor/html5lib/_trie/_base.py index a1158bbb..b4bc757a 100644 --- a/bleach/_vendor/html5lib/_trie/_base.py +++ b/bleach/_vendor/html5lib/_trie/_base.py @@ -1,6 +1,11 @@ from __future__ import absolute_import, division, unicode_literals -from collections import Mapping +try: + # Python 3 + from collections.abc import Mapping +except ImportError: + # Python 2.7 + from collections import Mapping class Trie(Mapping):