Revision 795
Added by Aaron Marcuse-Kubitza almost 13 years ago
lib/util.py | ||
---|---|---|
12 | 12 |
|
13 | 13 |
class ConstraintError(ValueError): |
14 | 14 |
def __init__(self, check_func, value): |
15 |
ValueError.__init__(self, type_name(value)+' '+str(value)
|
|
16 |
+' must satisfy constraint '+check_func.__name__+'()')
|
|
15 |
ValueError.__init__(self, str(value)+' must satisfy constraint '
|
|
16 |
+check_func.__name__)
|
|
17 | 17 |
|
18 | 18 |
def is_str(val): return isinstance(val, basestring) |
19 | 19 |
|
Also available in: Unified diff
util.py: Don't print type name in ConstraintError message because sometimes an entry tuple (e.g. from a dict) is checked, and then the type isn't useful