Commit 2066fa02 authored by Martin v. Löwis's avatar Martin v. Löwis

Find feature names in handler.

parent 424980fd
...@@ -7,7 +7,7 @@ version = "0.20" ...@@ -7,7 +7,7 @@ version = "0.20"
from xml.sax._exceptions import * from xml.sax._exceptions import *
from xml.parsers import expat from xml.parsers import expat
from xml.sax import xmlreader, saxutils from xml.sax import xmlreader, saxutils, handler
AttributesImpl = xmlreader.AttributesImpl AttributesImpl = xmlreader.AttributesImpl
AttributesNSImpl = xmlreader.AttributesNSImpl AttributesNSImpl = xmlreader.AttributesNSImpl
...@@ -47,14 +47,14 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator): ...@@ -47,14 +47,14 @@ class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator):
self._parser.SetBase(source.getSystemId()) self._parser.SetBase(source.getSystemId())
def getFeature(self, name): def getFeature(self, name):
if name == feature_namespaces: if name == handler.feature_namespaces:
return self._namespaces return self._namespaces
raise SAXNotRecognizedException("Feature '%s' not recognized" % name) raise SAXNotRecognizedException("Feature '%s' not recognized" % name)
def setFeature(self, name, state): def setFeature(self, name, state):
if self._parsing: if self._parsing:
raise SAXNotSupportedException("Cannot set features while parsing") raise SAXNotSupportedException("Cannot set features while parsing")
if name == feature_namespaces: if name == handler.feature_namespaces:
self._namespaces = state self._namespaces = state
else: else:
raise SAXNotRecognizedException("Feature '%s' not recognized" % raise SAXNotRecognizedException("Feature '%s' not recognized" %
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment