diff --git a/sumpy/tools.py b/sumpy/tools.py
index 863b4bb91749adef6ea65a374d697ecfa8d30bc4..540208f342e429326b7571168b754f02c0041d79 100644
--- a/sumpy/tools.py
+++ b/sumpy/tools.py
@@ -559,10 +559,13 @@ class MatrixBlockIndexRanges(object):
 # Author: Raymond Hettinger
 # License: MIT
 
-import collections
+try:
+    from collections.abc import MutableSet
+except ImportError:
+    from collections import MutableSet
 
 
-class OrderedSet(collections.MutableSet):
+class OrderedSet(MutableSet):
 
     def __init__(self, iterable=None):
         self.end = end = []