summaryrefslogtreecommitdiffstats
path: root/Lib/locale.py
diff options
context:
space:
mode:
authorHugo van Kemenade <hugovk@users.noreply.github.com>2023-10-27 13:08:45 (GMT)
committerGitHub <noreply@github.com>2023-10-27 13:08:45 (GMT)
commit7d22e855505bb1cd191b3ea224e828b084c0d699 (patch)
treec6894c58afdd370474fd06ff213f09fd45b01910 /Lib/locale.py
parent307ca78d7f97e6942c64383464a7de073d8b6e42 (diff)
downloadcpython-7d22e855505bb1cd191b3ea224e828b084c0d699.zip
cpython-7d22e855505bb1cd191b3ea224e828b084c0d699.tar.gz
cpython-7d22e855505bb1cd191b3ea224e828b084c0d699.tar.bz2
[3.12] gh-111187: Postpone removal version for locale.getdefaultlocale() to 3.15 (GH-111188) (#111323)
Diffstat (limited to 'Lib/locale.py')
-rw-r--r--Lib/locale.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/locale.py b/Lib/locale.py
index e94f0d1..4965c97 100644
--- a/Lib/locale.py
+++ b/Lib/locale.py
@@ -541,12 +541,14 @@ def getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')):
"""
import warnings
- warnings.warn(
- "Use setlocale(), getencoding() and getlocale() instead",
- DeprecationWarning, stacklevel=2
- )
+ warnings._deprecated(
+ "locale.getdefaultlocale",
+ "{name!r} is deprecated and slated for removal in Python {remove}. "
+ "Use setlocale(), getencoding() and getlocale() instead.",
+ remove=(3, 15))
return _getdefaultlocale(envvars)
+
def _getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')):
try:
# check if it's supported by the _locale module