Skip to content

Commit a6e0bfc

Browse files
committed
Error strings just show message when there are unset attributes
1 parent 6748a80 commit a6e0bfc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

jsonschema.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ def __str__(self):
109109
return unicode(self).encode("utf-8")
110110

111111
def __unicode__(self):
112+
if any(attr is _unset for attr in (
113+
self.validator, self.validator_value, self.instance, self.schema
114+
)):
115+
return self.message
112116
schema_path = ""
113117
if len(self.schema_path) > 1:
114118
schema_path = (

0 commit comments

Comments
 (0)