From 70c2c517f95a20fc6a76bdf5e29e186b747e422a Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 2 Jan 2019 14:57:24 -0500 Subject: [PATCH] Fix Py3.7 deprecation --- pytools/persistent_dict.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pytools/persistent_dict.py b/pytools/persistent_dict.py index dd051ba..75b162d 100644 --- a/pytools/persistent_dict.py +++ b/pytools/persistent_dict.py @@ -30,8 +30,12 @@ THE SOFTWARE. import logging logger = logging.getLogger(__name__) +try: + import collections.abc as abc +except ImportError: + # Python 2 + import collections as abc -import collections import functools import six import sys @@ -362,7 +366,7 @@ class _LinkedList(object): node[1] = node[2] = None -class _LRUCache(collections.MutableMapping): +class _LRUCache(abc.MutableMapping): """A mapping that keeps at most *maxsize* items with an LRU replacement policy. """ def __init__(self, maxsize): -- GitLab