From 6d38c750b71f9d5f379b0abdccd01533f494d1ed Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Mon, 10 May 2004 00:40:51 +0000 Subject: [PATCH] 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 --- ChangeLog | 6 ++++++ Makefile.am | 4 ++-- python/tests/Makefile.am | 2 +- python/tests/tstLastError.py | 11 ++++++++++- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 47d230a9..2e5b50a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun May 9 20:40:59 CEST 2004 Daniel Veillard + + * 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 + Sun May 9 19:46:13 CEST 2004 Daniel Veillard * xmlsave.c: apply fix for XHTML1 formating from Nick Wellnhofer diff --git a/Makefile.am b/Makefile.am index 87d6e4f0..26de7d04 100644 --- a/Makefile.am +++ b/Makefile.am @@ -906,7 +906,7 @@ Relaxtests: xmllint$(EXEEXT) RelaxNGPythonTests: @(if [ -x $(PYTHON) ] ; then \ - PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs ; \ + PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH ; \ export PYTHONPATH; \ echo "## Relax-NG Python based test suite 1" ; \ $(CHECKER) $(PYTHON) $(srcdir)/check-relaxng-test-suite.py ; \ @@ -916,7 +916,7 @@ RelaxNGPythonTests: SchemasPythonTests: @(if [ -x $(PYTHON) ] ; then \ - PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs; \ + PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH; \ export PYTHONPATH; \ echo "## XML Schemas datatypes Python based test suite" ; \ $(CHECKER) $(PYTHON) $(srcdir)/check-xsddata-test-suite.py ; \ 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: