IS_EXPR(lambda value: None(=)

This commit is contained in:
Massimo
2013-02-15 10:51:30 -06:00
parent 5618350c0b
commit 564f07e354
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.4.1-alpha.2+timestamp.2013.02.14.17.33.32
Version 2.4.1-alpha.2+timestamp.2013.02.15.10.50.49
+3
View File
@@ -237,6 +237,9 @@ class IS_EXPR(Validator):
self.environment = environment or {}
def __call__(self, value):
if callable(self.expression):
return (value, self.expression(value))
# for backward compatibility
self.environment.update(value=value)
exec '__ret__=' + self.expression in self.environment
if self.environment['__ret__']: