diff options
author | Hugo van Kemenade <hugovk@users.noreply.github.com> | 2023-10-25 13:47:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-25 13:47:41 (GMT) |
commit | 81ed80d843b3f6f0109e7ad854af2c5de27e1a89 (patch) | |
tree | 21bd884d2d882c63ca5f35584e4c77addf2092e0 /Lib/locale.py | |
parent | f6304949bb9937e798ecac8b414606dc01bc6d3c (diff) | |
download | cpython-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.py | 10 |
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 |