Commit b3ac18dc authored by Daniel Veillard's avatar Daniel Veillard
Browse files

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
parent f9b5fa2d
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
......
......@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment