From a195e4ea495323ffc64f95bfc84d4d388285879a Mon Sep 17 00:00:00 2001 From: sje1 Date: Fri, 12 Aug 2022 10:23:21 +0000 Subject: [PATCH] BUG 707: add python 10 support to be compatible with prior python --- generic_utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/generic_utils.py b/generic_utils.py index 7977681f5..8bc502ef5 100644 --- a/generic_utils.py +++ b/generic_utils.py @@ -35,6 +35,11 @@ import functools import sys +try: + collectionsAbc = collections.abc +except AttributeError: + collectionsAbc = collections + ################################################################ # # Debug @@ -79,7 +84,7 @@ def memoizer(*args, **kwargs): # ################################################################ -class OrderedSet(collections.MutableSet): +class OrderedSet(collectionsAbc.MutableSet): """ A set implementations that retains insertion order. From the receipe http://code.activestate.com/recipes/576694/