diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2004-05-11 13:06:29 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2004-05-11 13:06:29 +0000 |
commit | b3ac18dce8c260d99f6e37e25f37a96ef072773f (patch) | |
tree | f6dff34e6b321001dbd8c8da133bd98f544f6d42 /python/tests/tstLastError.py | |
parent | f9b5fa2dec22e88683d96d0a2782c244df2ca766 (diff) | |
download | android_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-x | python/tests/tstLastError.py | 11 |
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: |