version 1.1.1.1, 2012/02/21 23:38:00
|
version 1.1.1.2, 2014/06/15 19:53:34
|
Line 42 badexprs = (
|
Line 42 badexprs = (
|
for expr in badexprs: |
for expr in badexprs: |
try: |
try: |
ctxt.xpathEval(expr) |
ctxt.xpathEval(expr) |
except libxml2.xpathError, e: | except libxml2.xpathError: |
pass |
pass |
else: |
else: |
print "Unexpectedly legal expression:", expr | print("Unexpectedly legal expression:", expr) |
ctxt.xpathFreeContext() |
ctxt.xpathFreeContext() |
doc.freeDoc() |
doc.freeDoc() |
|
|
if err != expect: |
if err != expect: |
print "error" | print("error") |
print "received %s" %(err) | print("received %s" %(err)) |
print "expected %s" %(expect) | print("expected %s" %(expect)) |
sys.exit(1) |
sys.exit(1) |
|
|
libxml2.cleanupParser() |
libxml2.cleanupParser() |
leakedbytes = libxml2.debugMemory(True) |
leakedbytes = libxml2.debugMemory(True) |
if leakedbytes == 0: |
if leakedbytes == 0: |
print "OK" | print("OK") |
else: |
else: |
print "Memory leak", leakedbytes, "bytes" | print("Memory leak", leakedbytes, "bytes") |
# drop file to .memdump file in cwd, but won't work if not compiled in |
# drop file to .memdump file in cwd, but won't work if not compiled in |
libxml2.dumpMemory() |
libxml2.dumpMemory() |