mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-20 03:52:25 +03:00
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
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user