Validate types before asserting lengths (#56882)

pull/4420/head
Matt Martz 2019-05-23 16:51:28 -05:00 committed by GitHub
parent 6bb21c3db0
commit 9c5b72147e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -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)]),
), ),
) )