From 827173c527c2c0e92f46e8ea5996ea8b6fff1e48 Mon Sep 17 00:00:00 2001 From: Runming Lu Date: Fri, 9 Apr 2021 17:52:47 -0700 Subject: [PATCH] Import collections.abc instead of collections Importing ABCs from collectiions is deprecated since Python 3.3 and it will stop working in 3.9. Use import collections.abc instead --- pygtrie.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pygtrie.py b/pygtrie.py index 0c41e05..1a357b0 100644 --- a/pygtrie.py +++ b/pygtrie.py @@ -39,7 +39,10 @@ __copyright__ = 'Copyright 2014 Google Inc.' -import collections as _collections +try: + import collections.abc as _collections +except ImportError: + import collections as _collections # Python 2.x and 3.x compatibility stuff if hasattr(dict, 'iteritems'):