mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
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.
This commit is contained in:
parent
14e1506a6d
commit
6b606522ca
7 changed files with 21 additions and 13 deletions
|
|
@ -4088,7 +4088,7 @@ class BoolTest(unittest.TestCase):
|
|||
def test_warning(self):
|
||||
e = ET.fromstring('<a style="new"></a>')
|
||||
msg = (
|
||||
r"Testing an element's truth value will raise an exception in "
|
||||
r"Testing an element's truth value will always return True in "
|
||||
r"future versions. "
|
||||
r"Use specific 'len\(elem\)' or 'elem is not None' test instead.")
|
||||
with self.assertWarnsRegex(DeprecationWarning, msg):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue