summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2006-07-19 19:04:52 +0000
committerDaniel Veillard <veillard@src.gnome.org>2006-07-19 19:04:52 +0000
commitd3eaa2f845be6465a891dcf3ecacf934d82f833e (patch)
tree908b8f200a512fe04d55dfd0b234efc49523ad7b /python
parent4bcbf4443f02a69814a16fb5b34b81eb8828a62a (diff)
downloadlibxslt-d3eaa2f845be6465a891dcf3ecacf934d82f833e.tar.gz
libxslt-d3eaa2f845be6465a891dcf3ecacf934d82f833e.tar.bz2
libxslt-d3eaa2f845be6465a891dcf3ecacf934d82f833e.zip
fix float and boolean XPath conversions try to fix Stephane Bidoul attempt
* python/types.c: fix float and boolean XPath conversions * libxslt/xsltutils.c: try to fix Stephane Bidoul attempt at setting XInclude support. Daniel
Diffstat (limited to 'python')
-rw-r--r--python/types.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/python/types.c b/python/types.c
index 53bdd5cc..64163543 100644
--- a/python/types.c
+++ b/python/types.c
@@ -425,6 +425,19 @@ libxml_xmlXPathObjectPtrConvert(PyObject * obj)
if PyFloat_Check
(obj) {
ret = xmlXPathNewFloat((double) PyFloat_AS_DOUBLE(obj));
+ } else if PyInt_Check(obj) {
+
+ ret = xmlXPathNewFloat((double) PyInt_AS_LONG(obj));
+
+ } else if PyBool_Check (obj) {
+
+ if (obj == Py_True) {
+ ret = xmlXPathNewBoolean(1);
+ }
+ else {
+ ret = xmlXPathNewBoolean(0);
+ }
+
} else if PyString_Check
(obj) {
xmlChar *str;