Fix OrderedSet for Python 3.10+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-import collections
+try:
+ from collections import MutableSet
+except ImportError:
+ from collections.abc import MutableSet
-class OrderedSet(collections.MutableSet):
+class OrderedSet(MutableSet):
def __init__(self, iterable=None):
self.end = end = []
end += [None, end, end] # sentinel node for doubly linked list
