summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-06-07 03:43:17 (GMT)
committerGitHub <noreply@github.com>2024-06-07 03:43:17 (GMT)
commit56a7e0483436d1ebd2af97c02defe0e67c4bb495 (patch)
tree04b0c8ad8d4db46be7c8da2668301538345ee994 /Modules
parentd4566c0cfcc2f3db8fa61b35f99260c184416ba4 (diff)
downloadcpython-56a7e0483436d1ebd2af97c02defe0e67c4bb495.zip
cpython-56a7e0483436d1ebd2af97c02defe0e67c4bb495.tar.gz
cpython-56a7e0483436d1ebd2af97c02defe0e67c4bb495.tar.bz2
[3.13] gh-119577: Adjust DeprecationWarning when testing element truth values in ElementTree (GH-119762) (GH-120189)
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. (cherry picked from commit 6b606522ca97488aad6fe2f193d4511e7a8f8334) Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_elementtree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c
index b11983d..3818e20 100644
--- a/Modules/_elementtree.c
+++ b/Modules/_elementtree.c
@@ -1502,7 +1502,7 @@ element_bool(PyObject* self_)
{
ElementObject* self = (ElementObject*) self_;
if (PyErr_WarnEx(PyExc_DeprecationWarning,
- "Testing an element's truth value will raise an exception "
+ "Testing an element's truth value will always return True "
"in future versions. Use specific 'len(elem)' or "
"'elem is not None' test instead.",
1) < 0) {