diff --git a/misc/table_html_app.py b/misc/table_html_app.py
index 629325e..94e4726 100644
--- a/misc/table_html_app.py
+++ b/misc/table_html_app.py
@@ -88,7 +88,10 @@ class BasicRender(object):
self.autotable_render = AutoTableRenderer()
def render_response(self, request, context, _route):
- from collections import Sized
+ try:
+ from collections.abc import Sized
+ except ImportError:
+ from collections import Sized
if isinstance(context, basestring): # already serialized
if self._guess_json(context):
return Response(context, mimetype="application/json")
diff --git a/tests/test_dictutils.py b/tests/test_dictutils.py
index 7438d2e..b6873a8 100644
--- a/tests/test_dictutils.py
+++ b/tests/test_dictutils.py
@@ -88,10 +88,14 @@ def test_clear():
def test_types():
- import collections
+ try:
+ from collections.abc import MutableMapping
+ except ImportError:
+ from collections import MutableMapping
+
omd = OMD()
assert isinstance(omd, dict)
- assert isinstance(omd, collections.MutableMapping)
+ assert isinstance(omd, MutableMapping)
def test_multi_correctness():