diff options
author | Aron Xu <aron@debian.org> | 2013-06-09 00:17:44 +0800 |
---|---|---|
committer | Aron Xu <aron@debian.org> | 2013-06-09 00:17:44 +0800 |
commit | 2c8fe012ef1ff6e0613480dd182dec099aa9636e (patch) | |
tree | f220f4e6733d3204aef57831a8dee2dd8551ed40 /python/tests/tstLastError.py | |
parent | 3c845c4be476dc0ecb93388de9cfedb3f611e6a8 (diff) | |
download | libxml2-2c8fe012ef1ff6e0613480dd182dec099aa9636e.tar.gz |
Imported Upstream version 2.9.1upstream/2.9.1
Diffstat (limited to 'python/tests/tstLastError.py')
-rwxr-xr-x | python/tests/tstLastError.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/python/tests/tstLastError.py b/python/tests/tstLastError.py index d26e82c..d5f9be7 100755 --- a/python/tests/tstLastError.py +++ b/python/tests/tstLastError.py @@ -17,8 +17,8 @@ class TestCase(unittest.TestCase): if libxml2.debugMemory(1) != 0: libxml2.dumpMemory() self.fail("Memory leak %d bytes" % (libxml2.debugMemory(1),)) - else: - print "OK" + else: + print("OK") def failUnlessXmlError(self,f,args,exc,domain,code,message,level,file,line): """Run function f, with arguments args and expect an exception exc; @@ -27,19 +27,19 @@ class TestCase(unittest.TestCase): # disable the default error handler libxml2.registerErrorHandler(None,None) try: - apply(f,args) + f(*args) except exc: e = libxml2.lastError() if e is None: self.fail("lastError not set") if 0: - print "domain = ",e.domain() - print "code = ",e.code() - print "message =",repr(e.message()) - print "level =",e.level() - print "file =",e.file() - print "line =",e.line() - print + print("domain = ",e.domain()) + print("code = ",e.code()) + print("message =",repr(e.message())) + print("level =",e.level()) + print("file =",e.file()) + print("line =",e.line()) + print() self.failUnlessEqual(domain,e.domain()) self.failUnlessEqual(code,e.code()) self.failUnlessEqual(message,e.message()) |