diff options
author | Adam Tankanow <adam.tankanow@gmail.com> | 2020-12-07 12:08:56 -0500 |
---|---|---|
committer | Alec Thomas <alec@swapoff.org> | 2021-02-20 10:05:05 +1100 |
commit | ef32f11f159f856d88b766837ace1ed0fdefdb23 (patch) | |
tree | ab5366c536da5f4f6b2f21d7221c63957faa1995 | |
parent | 11b4a2fa6987ba957c1fdcc1b217f4d6d6c9037d (diff) | |
download | voluptuous-ef32f11f159f856d88b766837ace1ed0fdefdb23.tar.gz |
Revert "Ensure `Maybe` propagates error information (#411)"
This reverts commit da3cc967f7b16f18bf8c1feacfeced8f10ce9e40.
-rw-r--r-- | voluptuous/tests/tests.py | 2 | ||||
-rw-r--r-- | voluptuous/validators.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/voluptuous/tests/tests.py b/voluptuous/tests/tests.py index 54dcc7f..448abc3 100644 --- a/voluptuous/tests/tests.py +++ b/voluptuous/tests/tests.py @@ -516,7 +516,7 @@ def test_repr(): ) assert_equal(repr(coerce_), "Coerce(int, msg='moo')") assert_equal(repr(all_), "All('10', Coerce(int, msg=None), msg='all msg')") - assert_equal(repr(maybe_int), "Any(%s, None, msg=None)" % str(int)) + assert_equal(repr(maybe_int), "Any(None, %s, msg=None)" % str(int)) def test_list_validation_messages(): diff --git a/voluptuous/validators.py b/voluptuous/validators.py index 678e3d2..e8f8a8b 100644 --- a/voluptuous/validators.py +++ b/voluptuous/validators.py @@ -555,7 +555,7 @@ def Maybe(validator, msg=None): ... s("string") """ - return Any(validator, None, msg=msg) + return Any(None, validator, msg=msg) class Range(object): |