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

Method _set_prefix

Lib/xml/dom/minidom.py:414–427  ·  view source on GitHub ↗
(self, prefix)

Source from the content-addressed store, hash-verified

412 return self._prefix
413
414 def _set_prefix(self, prefix):
415 nsuri = self.namespaceURI
416 if prefix == "xmlns":
417 if nsuri and nsuri != XMLNS_NAMESPACE:
418 raise xml.dom.NamespaceErr(
419 "illegal use of 'xmlns' prefix for the wrong namespace")
420 self._prefix = prefix
421 if prefix is None:
422 newName = self.localName
423 else:
424 newName = "%s:%s" % (prefix, self.localName)
425 if self.ownerElement:
426 _clear_id_cache(self.ownerElement)
427 self.name = newName
428
429 prefix = property(_get_prefix, _set_prefix)
430

Callers

nothing calls this directly

Calls 1

_clear_id_cacheFunction · 0.85

Tested by

no test coverage detected