1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-03 08:58:17 +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:
Daniel Veillard 2004-05-11 13:06:29 +00:00
parent f9b5fa2dec
commit b3ac18dce8
2 changed files with 6 additions and 10 deletions

View File

@ -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>
* xmlregexp.c: enhanced xmlRegStateAddTrans to check if transition

View File

@ -21,16 +21,7 @@ class TestCase(unittest.TestCase):
# disable the default error handler
libxml2.registerErrorHandler(None,None)
try:
# Emulate f(*args) for older Pythons.
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")
apply(f,args)
except exc:
e = libxml2.lastError()
if e is None: