diff options
Diffstat (limited to 'tutorius/constraints.py')
-rw-r--r-- | tutorius/constraints.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tutorius/constraints.py b/tutorius/constraints.py index 36abdfb..e91f23a 100644 --- a/tutorius/constraints.py +++ b/tutorius/constraints.py @@ -200,7 +200,10 @@ class FileConstraint(Constraint): def validate(self, value): # TODO : Decide on the architecture for file retrieval on disk # Relative paths? From where? Support macros? - # + # FIXME This is a hack to make cases where a default file is not valid + # work. It allows None values to be validated, though + if value is None: + return if not os.path.isfile(value): raise FileConstraintError("Non-existing file : %s"%value) return |