diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2004-05-10 00:40:51 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2004-05-10 00:40:51 +0000 |
commit | 6d38c750b71f9d5f379b0abdccd01533f494d1ed (patch) | |
tree | 5786761be18978b1d5b268337bdcf6437d31dd13 /python/tests | |
parent | f0244cea968f14bbc7cf93e480ae8fec3e74d217 (diff) | |
download | libxml2-6d38c750b71f9d5f379b0abdccd01533f494d1ed.tar.gz |
applied patch from Ed Davis to allow "make tests" to work with Python 1.5
* Makefile.am python/tests/Makefile.am python/tests/tstLastError.py:
applied patch from Ed Davis to allow "make tests" to work
with Python 1.5
Daniel
Diffstat (limited to 'python/tests')
-rw-r--r-- | python/tests/Makefile.am | 2 | ||||
-rwxr-xr-x | python/tests/tstLastError.py | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/python/tests/Makefile.am b/python/tests/Makefile.am index 584ddbcd..bf048788 100644 --- a/python/tests/Makefile.am +++ b/python/tests/Makefile.am @@ -45,7 +45,7 @@ EXTRA_DIST = $(PYTESTS) $(XMLS) if WITH_PYTHON tests: $(PYTESTS) - -@(PYTHONPATH="..:../.libs:$(srcdir)/.." ; export PYTHONPATH; \ + -@(PYTHONPATH="..:../.libs:$(srcdir)/..:$$PYTHONPATH" ; export PYTHONPATH; \ for test in $(PYTESTS) ; do echo "-- $$test" ; $(PYTHON) $(srcdir)/$$test ; done) else tests: diff --git a/python/tests/tstLastError.py b/python/tests/tstLastError.py index 83e98b87..65addea7 100755 --- a/python/tests/tstLastError.py +++ b/python/tests/tstLastError.py @@ -21,7 +21,16 @@ class TestCase(unittest.TestCase): # disable the default error handler libxml2.registerErrorHandler(None,None) try: - f(*args) + # 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") except exc: e = libxml2.lastError() if e is None: |