From 96d91e61139675510e3f4565db8394fa6f67d080 Mon Sep 17 00:00:00 2001 From: Damien Maillard Date: Mon, 19 Sep 2016 14:53:35 +0200 Subject: [PATCH] Making errors argument optionnal issue #121 --- schema.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/schema.py b/schema.py index 8fb9f6f..5b25f48 100644 --- a/schema.py +++ b/schema.py @@ -16,7 +16,8 @@ class SchemaError(Exception): """Error during Schema validation.""" - def __init__(self, autos, errors): + def __init__(self, autos, errors=None): + errors = [] if errors is None else errors self.autos = autos if type(autos) is list else [autos] self.errors = errors if type(errors) is list else [errors] Exception.__init__(self, self.code)