1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-08-05 23:35:48 +03:00

Initial support for Python 3

Squashed merge of pull request !19.
This commit is contained in:
Suleyman Poyraz
2020-06-21 15:27:20 +03:00
committed by Nick Wellnhofer
parent 2c20c70cd8
commit a2db8da1ac
10 changed files with 519 additions and 260 deletions

View File

@@ -1,4 +1,6 @@
#!/usr/bin/python -u
from __future__ import print_function
import sys
import string
import libxml2
@@ -46,13 +48,13 @@ doc.freeDoc()
root = result.children
if root.name != "article":
print "Unexpected root node name"
print("Unexpected root node name")
sys.exit(1)
if root.content != "SUCCESS":
print "Unexpected root node content, extension function failed"
print("Unexpected root node content, extension function failed")
sys.exit(1)
if nodeName != 'article':
print "The function callback failed to access its context"
print("The function callback failed to access its context")
sys.exit(1)
result.freeDoc()
@@ -60,8 +62,8 @@ result.freeDoc()
# Memory debug specific
libxslt.cleanup()
if libxml2.debugMemory(1) == 0:
print "OK"
print("OK")
else:
print "Memory leak %d bytes" % (libxml2.debugMemory(1))
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
libxml2.dumpMemory()
sys.exit(255)