aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2006-06-18 17:40:53 +0000
committerDaniel Veillard <veillard@src.gnome.org>2006-06-18 17:40:53 +0000
commita4bd369232f700aed90da69520d9ea7c9098a935 (patch)
tree06623d6f3e4a652eba42d92b17a91e551991004c /python
parent381ff364dc6deacdf18606c0196a9e913cf76a87 (diff)
downloadandroid_external_libxml2-a4bd369232f700aed90da69520d9ea7c9098a935.tar.gz
android_external_libxml2-a4bd369232f700aed90da69520d9ea7c9098a935.tar.bz2
android_external_libxml2-a4bd369232f700aed90da69520d9ea7c9098a935.zip
patch from Nic Ferrier to provide a better type mapping from XPath to
* python/types.c: patch from Nic Ferrier to provide a better type mapping from XPath to python Daniel
Diffstat (limited to 'python')
-rw-r--r--python/types.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/python/types.c b/python/types.c
index 8a6a9a0e..6bcbcf69 100644
--- a/python/types.c
+++ b/python/types.c
@@ -422,6 +422,20 @@ 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;