summaryrefslogtreecommitdiffstats
path: root/Lib/locale.py
diff options
context:
space:
mode:
authorHugo van Kemenade <hugovk@users.noreply.github.com>2023-10-25 13:47:41 (GMT)
committerGitHub <noreply@github.com>2023-10-25 13:47:41 (GMT)
commit81ed80d843b3f6f0109e7ad854af2c5de27e1a89 (patch)
tree21bd884d2d882c63ca5f35584e4c77addf2092e0 /Lib/locale.py
parentf6304949bb9937e798ecac8b414606dc01bc6d3c (diff)
downloadcpython-81ed80d843b3f6f0109e7ad854af2c5de27e1a89.zip
cpython-81ed80d843b3f6f0109e7ad854af2c5de27e1a89.tar.gz
cpython-81ed80d843b3f6f0109e7ad854af2c5de27e1a89.tar.bz2
gh-111187: Postpone removal version for locale.getdefaultlocale() to 3.15 (#111188)
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 55c819c..e0cb4c5 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