| 5 | ARG = 'test string' |
| 6 | |
| 7 | class ErrorHandler: |
| 8 | |
| 9 | def __init__(self): |
| 10 | self.errors = [] |
| 11 | |
| 12 | def handler(self, msg, data): |
| 13 | if data != ARG: |
| 14 | raise Exception, "Error handler did not receive correct argument" |
| 15 | self.errors.append(msg) |
| 16 | |
| 17 | # Memory debug specific |
| 18 | libxml2.debugMemory(1) |