summaryrefslogtreecommitdiffstats
path: root/Lib/locale.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/locale.py')
-rw-r--r--Lib/locale.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/Lib/locale.py b/Lib/locale.py
index 25eb75ac..7a7694e 100644
--- a/Lib/locale.py
+++ b/Lib/locale.py
@@ -633,7 +633,17 @@ def resetlocale(category=LC_ALL):
getdefaultlocale(). category defaults to LC_ALL.
"""
- _setlocale(category, _build_localename(getdefaultlocale()))
+ import warnings
+ warnings.warn(
+ 'Use locale.setlocale(locale.LC_ALL, "") instead',
+ DeprecationWarning, stacklevel=2
+ )
+
+ with warnings.catch_warnings():
+ warnings.simplefilter('ignore', category=DeprecationWarning)
+ loc = getdefaultlocale()
+
+ _setlocale(category, _build_localename(loc))
try: