mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
DeprecationWarning is now silent by default.
This was originally suggested by Guido, discussed on the stdlib-sig mailing list, and given the OK by Guido directly to me. What this change essentially means is that Python has taken a policy of silencing warnings that are only of interest to developers by default. This should prevent users from seeing warnings which are triggered by an application being run against a new interpreter before the app developer has a chance to update their code. Closes issue #7319. Thanks to Antoine Pitrou, Ezio Melotti, and Brian Curtin for helping with the issue.
This commit is contained in:
parent
3ad57e2625
commit
6fdd3dcb6a
6 changed files with 65 additions and 31 deletions
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
import unittest
|
||||
from test_support import check_warnings, run_unittest, cpython_only
|
||||
import warnings
|
||||
|
||||
|
||||
class FormatDeprecationTests(unittest.TestCase):
|
||||
|
|
@ -17,6 +18,7 @@ class FormatDeprecationTests(unittest.TestCase):
|
|||
buf = create_string_buffer(' ' * 100)
|
||||
|
||||
with check_warnings() as w:
|
||||
warnings.simplefilter('default')
|
||||
PyOS_ascii_formatd(byref(buf), sizeof(buf), '%+.10f',
|
||||
c_double(10.0))
|
||||
self.assertEqual(buf.value, '+10.0000000000')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue