|
|
| version 1.1.1.1, 2012/02/21 23:38:00 | version 1.1.1.2, 2014/06/15 19:53:34 |
|---|---|
| Line 20 class callback: | Line 20 class callback: |
| def startDocument(self): | def startDocument(self): |
| global ctxt | global ctxt |
| if ctxt.byteConsumed() != self.startd: | if ctxt.byteConsumed() != self.startd: |
| print "document start at wrong index: %d expecting %d\n" % ( | print("document start at wrong index: %d expecting %d\n" % ( |
| ctxt.byteConsumed(), self.startd) | ctxt.byteConsumed(), self.startd)) |
| sys.exit(1) | sys.exit(1) |
| def endDocument(self): | def endDocument(self): |
| global ctxt | global ctxt |
| expect = self.ende + self.delta * (self.count - 1) + self.endd | expect = self.ende + self.delta * (self.count - 1) + self.endd |
| if ctxt.byteConsumed() != expect: | if ctxt.byteConsumed() != expect: |
| print "document end at wrong index: %d expecting %d\n" % ( | print("document end at wrong index: %d expecting %d\n" % ( |
| ctxt.byteConsumed(), expect) | ctxt.byteConsumed(), expect)) |
| sys.exit(1) | sys.exit(1) |
| def startElement(self, tag, attrs): | def startElement(self, tag, attrs): |
| Line 37 class callback: | Line 37 class callback: |
| if tag == "bar1": | if tag == "bar1": |
| expect = self.starte + self.delta * self.count | expect = self.starte + self.delta * self.count |
| if ctxt.byteConsumed() != expect: | if ctxt.byteConsumed() != expect: |
| print "element start at wrong index: %d expecting %d\n" % ( | print("element start at wrong index: %d expecting %d\n" % ( |
| ctxt.byteConsumed(), expect) | ctxt.byteConsumed(), expect)) |
| sys.exit(1) | sys.exit(1) |
| Line 47 class callback: | Line 47 class callback: |
| if tag == "bar1": | if tag == "bar1": |
| expect = self.ende + self.delta * self.count | expect = self.ende + self.delta * self.count |
| if ctxt.byteConsumed() != expect: | if ctxt.byteConsumed() != expect: |
| print "element end at wrong index: %d expecting %d\n" % ( | print("element end at wrong index: %d expecting %d\n" % ( |
| ctxt.byteConsumed(), expect) | ctxt.byteConsumed(), expect)) |
| sys.exit(1) | sys.exit(1) |
| self.count = self.count + 1 | self.count = self.count + 1 |
| Line 107 ctxt=None | Line 107 ctxt=None |
| # Memory debug specific | # Memory debug specific |
| libxml2.cleanupParser() | libxml2.cleanupParser() |
| if libxml2.debugMemory(1) == 0: | if libxml2.debugMemory(1) == 0: |
| print "OK" | print("OK") |
| else: | else: |
| print "Memory leak %d bytes" % (libxml2.debugMemory(1)) | print("Memory leak %d bytes" % (libxml2.debugMemory(1))) |
| libxml2.dumpMemory() | libxml2.dumpMemory() |