summaryrefslogtreecommitdiff
path: root/src/lxml/objectpath.pxi
diff options
context:
space:
mode:
authorscoder <none@none>2009-02-14 23:16:08 +0100
committerscoder <none@none>2009-02-14 23:16:08 +0100
commita2d4065239de99e6ff49591cd3b43429258355dd (patch)
tree72e9f5868a241025cb3393e4f589554627415e09 /src/lxml/objectpath.pxi
parentff77d93815ebbeae8ba472533d4aeb041b0f5e2f (diff)
downloadpython-lxml-a2d4065239de99e6ff49591cd3b43429258355dd.tar.gz
[svn r4086] r4998@delle: sbehnel | 2009-02-14 23:13:57 +0100
fixes for Py3 --HG-- branch : trunk
Diffstat (limited to 'src/lxml/objectpath.pxi')
-rw-r--r--src/lxml/objectpath.pxi6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lxml/objectpath.pxi b/src/lxml/objectpath.pxi
index c1b89b94..ee85b0db 100644
--- a/src/lxml/objectpath.pxi
+++ b/src/lxml/objectpath.pxi
@@ -105,10 +105,10 @@ cdef _parseObjectPathString(path):
break
dot, ns, name, index = match.groups()
- if index is None or python.PyUnicode_GET_SIZE(index) == 0:
+ if index is None or not index:
index = 0
else:
- index = python.PyNumber_Int(index)
+ index = int(index)
has_dot = dot == u'.'
if python.PyList_GET_SIZE(new_path) == 0:
if has_dot:
@@ -152,7 +152,7 @@ cdef _parseObjectPathList(path):
index_end = cstd.strchr(index_pos + 1, c']')
if index_end is NULL:
raise ValueError, u"index must be enclosed in []"
- index = python.PyNumber_Int(
+ index = int(
python.PyString_FromStringAndSize(
index_pos + 1, <Py_ssize_t>(index_end - index_pos - 1)))
if python.PyList_GET_SIZE(new_path) == 0 and index != 0: