From 98f233defd6d06dbc9a6075b9b9f27d597c28d20 Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Wed, 9 Jan 2019 15:01:56 +0100 Subject: [PATCH] Fix collections ABC deprecation warning. --- matrix/utf.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/matrix/utf.py b/matrix/utf.py index 320cb58..4d71987 100644 --- a/matrix/utf.py +++ b/matrix/utf.py @@ -28,9 +28,13 @@ import sys # pylint: disable=redefined-builtin from builtins import bytes, str -from collections import Iterable, Mapping from functools import wraps +if sys.version_info.major == 3 and sys.version_info.minor >= 3: + from collections.abc import Iterable, Mapping +else: + from collections import Iterable, Mapping + # These functions were written by Trygve Aaberge for wee-slack and are under a # MIT License. # More info can be found in the wee-slack repository under the commit: