~doctormo/pyvalidate/trunk

« back to all changes in this revision

Viewing changes to lib/xssd/errors.py

  • Committer: Martin Owens
  • Date: 2014-05-18 23:48:50 UTC
  • Revision ID: doctormo@gmail.com-20140518234850-02kbvsquoi19ymd3
Fix python3 support

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
            return False
87
87
        return self._in_error != 0
88
88
 
 
89
    def __bool__(self):
 
90
        "PY3 for nonzero"
 
91
        return self.__nonzero__()
 
92
 
89
93
    def __eq__(self, errors):
90
94
        if not isinstance(errors, dict):
91
95
            return False
135
139
    def __nonzero__(self):
136
140
        return self._code > 0
137
141
 
 
142
    def __bool__(self):
 
143
        "PY3 for nonzero"
 
144
        return self.__nonzero__()
 
145
 
138
146
    def __eq__(self, opt):
139
147
        if isinstance(opt, ValidateError):
140
148
            opt = opt._code