aboutsummaryrefslogtreecommitdiffstats
path: root/python/tests/tstLastError.py
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2004-05-11 13:06:29 +0000
committerDaniel Veillard <veillard@src.gnome.org>2004-05-11 13:06:29 +0000
commitb3ac18dce8c260d99f6e37e25f37a96ef072773f (patch)
treef6dff34e6b321001dbd8c8da133bd98f544f6d42 /python/tests/tstLastError.py
parentf9b5fa2dec22e88683d96d0a2782c244df2ca766 (diff)
downloadandroid_external_libxml2-b3ac18dce8c260d99f6e37e25f37a96ef072773f.tar.gz
android_external_libxml2-b3ac18dce8c260d99f6e37e25f37a96ef072773f.tar.bz2
android_external_libxml2-b3ac18dce8c260d99f6e37e25f37a96ef072773f.zip
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
Diffstat (limited to 'python/tests/tstLastError.py')
-rwxr-xr-xpython/tests/tstLastError.py11
1 files changed, 1 insertions, 10 deletions
diff --git a/python/tests/tstLastError.py b/python/tests/tstLastError.py
index 65addea7..442609ca 100755
--- a/python/tests/tstLastError.py
+++ b/python/tests/tstLastError.py
@@ -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: