diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-04-05 06:37:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-05 06:37:24 (GMT) |
commit | 5affd23e6f42125998724787025080a24839266e (patch) | |
tree | 8b7ca82362e78a32805b117d574082d512251d3c /Lib/xml | |
parent | 43ba8861e0ad044efafa46a7cc04e12ac5df640e (diff) | |
download | cpython-5affd23e6f42125998724787025080a24839266e.zip cpython-5affd23e6f42125998724787025080a24839266e.tar.gz cpython-5affd23e6f42125998724787025080a24839266e.tar.bz2 |
bpo-29762: More use "raise from None". (#569)
This hides unwanted implementation details from tracebacks.
Diffstat (limited to 'Lib/xml')
-rw-r--r-- | Lib/xml/dom/xmlbuilder.py | 2 | ||||
-rw-r--r-- | Lib/xml/etree/ElementPath.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Lib/xml/dom/xmlbuilder.py b/Lib/xml/dom/xmlbuilder.py index e9a1536..60a2bc3 100644 --- a/Lib/xml/dom/xmlbuilder.py +++ b/Lib/xml/dom/xmlbuilder.py @@ -80,7 +80,7 @@ class DOMBuilder: settings = self._settings[(_name_xform(name), state)] except KeyError: raise xml.dom.NotSupportedErr( - "unsupported feature: %r" % (name,)) + "unsupported feature: %r" % (name,)) from None else: for name, value in settings: setattr(self._options, name, value) diff --git a/Lib/xml/etree/ElementPath.py b/Lib/xml/etree/ElementPath.py index ab6b79a..361f6d5 100644 --- a/Lib/xml/etree/ElementPath.py +++ b/Lib/xml/etree/ElementPath.py @@ -80,7 +80,7 @@ def xpath_tokenizer(pattern, namespaces=None): raise KeyError yield token[0], "{%s}%s" % (namespaces[prefix], uri) except KeyError: - raise SyntaxError("prefix %r not found in prefix map" % prefix) + raise SyntaxError("prefix %r not found in prefix map" % prefix) from None else: yield token |