summaryrefslogtreecommitdiff
path: root/src/lxml/xmlid.pxi
diff options
context:
space:
mode:
authorscoder <none@none>2008-04-25 23:31:46 +0200
committerscoder <none@none>2008-04-25 23:31:46 +0200
commit00171a9450ef1b1da0ad284cbfd1987d4bad197e (patch)
treef4aa937692a771adc187030f4a6c5daa8114a5c6 /src/lxml/xmlid.pxi
parent9e1787c0ac389e8a46061bf9604198bd8fd92344 (diff)
downloadpython-lxml-00171a9450ef1b1da0ad284cbfd1987d4bad197e.tar.gz
[svn r3603] r4092@delle: sbehnel | 2008-04-25 22:47:11 +0200
simpler exception raising code --HG-- branch : trunk
Diffstat (limited to 'src/lxml/xmlid.pxi')
-rw-r--r--src/lxml/xmlid.pxi6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lxml/xmlid.pxi b/src/lxml/xmlid.pxi
index 88ba6206..a8d84b09 100644
--- a/src/lxml/xmlid.pxi
+++ b/src/lxml/xmlid.pxi
@@ -69,7 +69,7 @@ cdef class _IDDict:
cdef _Document doc
doc = _documentOrRaise(etree)
if doc._c_doc.ids is NULL:
- raise ValueError("No ID dictionary available.")
+ raise ValueError, "No ID dictionary available."
self._doc = doc
self._keys = None
self._items = None
@@ -85,10 +85,10 @@ cdef class _IDDict:
id_utf = _utf8(id_name)
c_id = <tree.xmlID*>tree.xmlHashLookup(c_ids, _cstr(id_utf))
if c_id is NULL:
- raise KeyError("key not found.")
+ raise KeyError, "key not found."
c_attr = c_id.attr
if c_attr is NULL or c_attr.parent is NULL:
- raise KeyError("ID attribute not found.")
+ raise KeyError, "ID attribute not found."
return _elementFactory(self._doc, c_attr.parent)
def get(self, id_name):