diff options
author | Victor Stinner <vstinner@python.org> | 2022-02-22 21:06:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-22 21:06:43 (GMT) |
commit | b899126094731bc49fecb61f2c1b7557d74ca839 (patch) | |
tree | 0fcb5dbe42994f32e7caf03514cbfd11fdca825b /Lib/test/test_locale.py | |
parent | ccbe8045faf6e63d36229ea4e1b9298572cda126 (diff) | |
download | cpython-b899126094731bc49fecb61f2c1b7557d74ca839.zip cpython-b899126094731bc49fecb61f2c1b7557d74ca839.tar.gz cpython-b899126094731bc49fecb61f2c1b7557d74ca839.tar.bz2 |
bpo-46659: Deprecate locale.getdefaultlocale() (GH-31206)
The locale.getdefaultlocale() function is deprecated and will be
removed in Python 3.13. Use locale.setlocale(),
locale.getpreferredencoding(False) and locale.getlocale() functions
instead.
Diffstat (limited to 'Lib/test/test_locale.py')
-rw-r--r-- | Lib/test/test_locale.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py index f844e62..2a3b0ac 100644 --- a/Lib/test/test_locale.py +++ b/Lib/test/test_locale.py @@ -518,7 +518,8 @@ class TestMiscellaneous(unittest.TestCase): os.environ['LC_CTYPE'] = 'UTF-8' - self.assertEqual(locale.getdefaultlocale(), (None, 'UTF-8')) + with check_warnings(('', DeprecationWarning)): + self.assertEqual(locale.getdefaultlocale(), (None, 'UTF-8')) finally: for k in orig_env: |