summaryrefslogtreecommitdiffstats
path: root/Lib/xml/etree/ElementTree.py
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2024-06-07 03:18:30 (GMT)
committerGitHub <noreply@github.com>2024-06-07 03:18:30 (GMT)
commit6b606522ca97488aad6fe2f193d4511e7a8f8334 (patch)
tree39a2f4ea67ddb62eb1ae01768cc20c6b60e2a41d /Lib/xml/etree/ElementTree.py
parent14e1506a6d7056c38fbbc0797268dcf783f91243 (diff)
downloadcpython-6b606522ca97488aad6fe2f193d4511e7a8f8334.zip
cpython-6b606522ca97488aad6fe2f193d4511e7a8f8334.tar.gz
cpython-6b606522ca97488aad6fe2f193d4511e7a8f8334.tar.bz2
gh-119577: Adjust DeprecationWarning when testing element truth values in ElementTree (GH-119762)
Adjust DeprecationWarning when testing element truth values in ElementTree, we're planning to go with the more natural True return rather than a disruptive harder to code around exception raise, and are deferring the behavior change for a few more releases.
Diffstat (limited to 'Lib/xml/etree/ElementTree.py')
-rw-r--r--Lib/xml/etree/ElementTree.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py
index 9e15d34..ce67d7d 100644
--- a/Lib/xml/etree/ElementTree.py
+++ b/Lib/xml/etree/ElementTree.py
@@ -201,7 +201,7 @@ class Element:
def __bool__(self):
warnings.warn(
- "Testing an element's truth value will raise an exception in "
+ "Testing an element's truth value will always return True in "
"future versions. "
"Use specific 'len(elem)' or 'elem is not None' test instead.",
DeprecationWarning, stacklevel=2