Skip to content

Commit 499596c

Browse files
committed
gh-130796: Undeprecate locale.getdefaultlocale()
1 parent 3960878 commit 499596c

File tree

3 files changed

+1
-10
lines changed

3 files changed

+1
-10
lines changed

Doc/library/locale.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,8 +370,6 @@ The :mod:`locale` module defines the following exception and functions:
370370
determined.
371371
The "C" locale is represented as ``(None, None)``.
372372

373-
.. deprecated-removed:: 3.11 3.15
374-
375373

376374
.. function:: getlocale(category=LC_CTYPE)
377375

Lib/locale.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -559,12 +559,6 @@ def getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')):
559559
560560
"""
561561

562-
import warnings
563-
warnings._deprecated(
564-
"locale.getdefaultlocale",
565-
"{name!r} is deprecated and slated for removal in Python {remove}. "
566-
"Use setlocale(), getencoding() and getlocale() instead.",
567-
remove=(3, 15))
568562
return _getdefaultlocale(envvars)
569563

570564

Lib/test/test_locale.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,8 +654,7 @@ def test_defaults_UTF8(self):
654654
env.unset('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')
655655
env.set('LC_CTYPE', 'UTF-8')
656656

657-
with check_warnings(('', DeprecationWarning)):
658-
self.assertEqual(locale.getdefaultlocale(), (None, 'UTF-8'))
657+
self.assertEqual(locale.getdefaultlocale(), (None, 'UTF-8'))
659658
finally:
660659
if orig_getlocale is not None:
661660
_locale._getdefaultlocale = orig_getlocale

0 commit comments

Comments
 (0)