From 6162376bc61f3c7055a19dc87d9883a690629195 Mon Sep 17 00:00:00 2001 From: Johannes Kulick Date: Thu, 9 Dec 2021 09:29:16 +0100 Subject: [PATCH] Use collections.abc.Sequence Problem: `collections.Sequence` has moved to the `collections.abc` in python 3.3 and will be removed in 3.10: https://docs.python.org/3.9/library/collections.html#:~:text=Deprecated%20since%20version%203.3%2C%20will%20be%20removed%20in%20version%203.10%3A%20Moved%20Collections%20Abstract%20Base%20Classes%20to%20the%20collections.abc%20module.%20For%20backwards%20compatibility%2C%20they%20continue%20to%20be%20visible%20in%20this%20module%20through%20Python%203.9. Solution Use `collections.abc.Sequence` instead. --- valideer/validators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/valideer/validators.py b/valideer/validators.py index ebd91f3..58c4129 100644 --- a/valideer/validators.py +++ b/valideer/validators.py @@ -466,7 +466,7 @@ def _PatternFactory(obj): class HomogeneousSequence(Type): """A validator that accepts homogeneous, non-fixed size sequences.""" - accept_types = collections.Sequence + accept_types = collections.abc.Sequence reject_types = string_types def __init__(self, item_schema=None, min_length=None, max_length=None):