mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
better portability fix for f(*args), use apply(f, args) as Stephane Bidoul
* python/tests/tstLastError.py: better portability fix for f(*args), use apply(f, args) as Stephane Bidoul suggested Daniel
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
Tue May 11 09:06:53 CEST 2004 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* python/tests/tstLastError.py: better portability fix for f(*args),
|
||||||
|
use apply(f, args) as Stephane Bidoul suggested
|
||||||
|
|
||||||
Mon May 10 15:49:22 HKT 2004 William Brack <wbrack@mmm.com.hk>
|
Mon May 10 15:49:22 HKT 2004 William Brack <wbrack@mmm.com.hk>
|
||||||
|
|
||||||
* xmlregexp.c: enhanced xmlRegStateAddTrans to check if transition
|
* xmlregexp.c: enhanced xmlRegStateAddTrans to check if transition
|
||||||
|
@ -21,16 +21,7 @@ class TestCase(unittest.TestCase):
|
|||||||
# disable the default error handler
|
# disable the default error handler
|
||||||
libxml2.registerErrorHandler(None,None)
|
libxml2.registerErrorHandler(None,None)
|
||||||
try:
|
try:
|
||||||
# Emulate f(*args) for older Pythons.
|
apply(f,args)
|
||||||
l = len(args)
|
|
||||||
if l == 0: f
|
|
||||||
elif l == 1: f(args[0])
|
|
||||||
elif l == 2: f(args[0], args[1])
|
|
||||||
elif l == 3: f(args[0], args[1], args[2])
|
|
||||||
elif l == 4: f(args[0], args[1], args[2], args[3])
|
|
||||||
elif l == 5: f(args[0], args[1], args[2], args[3], args[4])
|
|
||||||
else:
|
|
||||||
self.fail("Too many arguments for function")
|
|
||||||
except exc:
|
except exc:
|
||||||
e = libxml2.lastError()
|
e = libxml2.lastError()
|
||||||
if e is None:
|
if e is None:
|
||||||
|
Reference in New Issue
Block a user