[stable-2.6] Validate types before asserting lengths (#56882)
(cherry picked from commit 9c5b721
)
Co-authored-by: Matt Martz <matt@sivel.net>
This commit is contained in:
parent
fb96b88122
commit
03bab95231
1 changed files with 4 additions and 4 deletions
|
@ -25,13 +25,13 @@ def sequence_of_sequences(min=None, max=None):
|
||||||
return All(
|
return All(
|
||||||
Any(
|
Any(
|
||||||
None,
|
None,
|
||||||
[Length(min=min, max=max)],
|
[Any(list, tuple)],
|
||||||
tuple([Length(min=min, max=max)]),
|
tuple([Any(list, tuple)]),
|
||||||
),
|
),
|
||||||
Any(
|
Any(
|
||||||
None,
|
None,
|
||||||
[Any(list, tuple)],
|
[Length(min=min, max=max)],
|
||||||
tuple([Any(list, tuple)]),
|
tuple([Length(min=min, max=max)]),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue