MCPcopy Index your code
hub / github.com/python/cpython / setFeature

Method setFeature

Lib/xml/sax/expatreader.py:134–162  ·  view source on GitHub ↗
(self, name, state)

Source from the content-addressed store, hash-verified

132 raise SAXNotRecognizedException("Feature '%s' not recognized" % name)
133
134 def setFeature(self, name, state):
135 if self._parsing:
136 raise SAXNotSupportedException("Cannot set features while parsing")
137
138 if name == feature_namespaces:
139 self._namespaces = state
140 elif name == feature_external_ges:
141 self._external_ges = state
142 elif name == feature_string_interning:
143 if state:
144 if self._interning is None:
145 self._interning = {}
146 else:
147 self._interning = None
148 elif name == feature_validation:
149 if state:
150 raise SAXNotSupportedException(
151 "expat does not support validation")
152 elif name == feature_external_pes:
153 if state:
154 raise SAXNotSupportedException(
155 "expat does not read external parameter entities")
156 elif name == feature_namespace_prefixes:
157 if state:
158 raise SAXNotSupportedException(
159 "expat does not report namespace prefixes")
160 else:
161 raise SAXNotRecognizedException(
162 "Feature '%s' not recognized" % name)
163
164 def getProperty(self, name):
165 if name == handler.property_lexical_handler:

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected