Skip to content

Commit

Permalink
Merge pull request #122 from DaMaillard/patch-1
Browse files Browse the repository at this point in the history
Making errors argument optionnal
  • Loading branch information
skorokithakis authored Sep 19, 2016
2 parents d4231d2 + 96d91e6 commit 49a787f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 49a787f

Please sign in to comment.