diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-06-07 03:43:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-07 03:43:17 (GMT) |
commit | 56a7e0483436d1ebd2af97c02defe0e67c4bb495 (patch) | |
tree | 04b0c8ad8d4db46be7c8da2668301538345ee994 /Lib/xml | |
parent | d4566c0cfcc2f3db8fa61b35f99260c184416ba4 (diff) | |
download | cpython-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 'Lib/xml')
-rw-r--r-- | Lib/xml/etree/ElementTree.py | 2 |
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 |