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
diff --git a/ChangeLog b/ChangeLog
index 47d230a..2e5b50a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sun May 9 20:40:59 CEST 2004 Daniel Veillard <daniel@veillard.com>
+
+ * 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 <daniel@veillard.com>
* xmlsave.c: apply fix for XHTML1 formating from Nick Wellnhofer
diff --git a/Makefile.am b/Makefile.am
index 87d6e4f..26de7d0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -906,7 +906,7 @@
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 @@
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 584ddbc..bf04878 100644
--- a/python/tests/Makefile.am
+++ b/python/tests/Makefile.am
@@ -45,7 +45,7 @@
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 83e98b8..65addea 100755
--- a/python/tests/tstLastError.py
+++ b/python/tests/tstLastError.py
@@ -21,7 +21,16 @@
# 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: