|
25 | 25 | # Yuck: LC_MESSAGES is non-standard: can't tell whether it exists before |
26 | 26 | # trying the import. So __all__ is also fiddled at the end of the file. |
27 | 27 | __all__ = ["getlocale", "getdefaultlocale", "getpreferredencoding", "Error", |
28 | | - "setlocale", "resetlocale", "localeconv", "strcoll", "strxfrm", |
| 28 | + "setlocale", "localeconv", "strcoll", "strxfrm", |
29 | 29 | "str", "atof", "atoi", "format_string", "currency", |
30 | 30 | "normalize", "LC_CTYPE", "LC_COLLATE", "LC_TIME", "LC_MONETARY", |
31 | 31 | "LC_NUMERIC", "LC_ALL", "CHAR_MAX", "getencoding"] |
@@ -612,26 +612,6 @@ def setlocale(category, locale=None): |
612 | 612 | locale = normalize(_build_localename(locale)) |
613 | 613 | return _setlocale(category, locale) |
614 | 614 |
|
615 | | -def resetlocale(category=LC_ALL): |
616 | | - |
617 | | - """ Sets the locale for category to the default setting. |
618 | | -
|
619 | | - The default setting is determined by calling |
620 | | - getdefaultlocale(). category defaults to LC_ALL. |
621 | | -
|
622 | | - """ |
623 | | - import warnings |
624 | | - warnings.warn( |
625 | | - 'Use locale.setlocale(locale.LC_ALL, "") instead', |
626 | | - DeprecationWarning, stacklevel=2 |
627 | | - ) |
628 | | - |
629 | | - with warnings.catch_warnings(): |
630 | | - warnings.simplefilter('ignore', category=DeprecationWarning) |
631 | | - loc = getdefaultlocale() |
632 | | - |
633 | | - _setlocale(category, _build_localename(loc)) |
634 | | - |
635 | 615 |
|
636 | 616 | try: |
637 | 617 | from _locale import getencoding |
@@ -1729,17 +1709,6 @@ def _init_categories(categories=categories): |
1729 | 1709 | print(' Encoding: ', enc or '(undefined)') |
1730 | 1710 | print() |
1731 | 1711 |
|
1732 | | - print() |
1733 | | - print('Locale settings after calling resetlocale():') |
1734 | | - print('-'*72) |
1735 | | - resetlocale() |
1736 | | - for name,category in categories.items(): |
1737 | | - print(name, '...') |
1738 | | - lang, enc = getlocale(category) |
1739 | | - print(' Language: ', lang or '(undefined)') |
1740 | | - print(' Encoding: ', enc or '(undefined)') |
1741 | | - print() |
1742 | | - |
1743 | 1712 | try: |
1744 | 1713 | setlocale(LC_ALL, "") |
1745 | 1714 | except: |
|
0 commit comments