Skip to content

Commit 9970c4c

Browse files
jopemachineyouknowone
authored andcommitted
Update Lib/locale.py from CPython v3.12.0a0
1 parent ad5ffb6 commit 9970c4c

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

Lib/locale.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# trying the import. So __all__ is also fiddled at the end of the file.
2727
__all__ = ["getlocale", "getdefaultlocale", "getpreferredencoding", "Error",
2828
"setlocale", "resetlocale", "localeconv", "strcoll", "strxfrm",
29-
"str", "atof", "atoi", "format", "format_string", "currency",
29+
"str", "atof", "atoi", "format_string", "currency",
3030
"normalize", "LC_CTYPE", "LC_COLLATE", "LC_TIME", "LC_MONETARY",
3131
"LC_NUMERIC", "LC_ALL", "CHAR_MAX", "getencoding"]
3232

@@ -247,21 +247,6 @@ def format_string(f, val, grouping=False, monetary=False):
247247

248248
return new_f % val
249249

250-
def format(percent, value, grouping=False, monetary=False, *additional):
251-
"""Deprecated, use format_string instead."""
252-
import warnings
253-
warnings.warn(
254-
"This method will be removed in a future version of Python. "
255-
"Use 'locale.format_string()' instead.",
256-
DeprecationWarning, stacklevel=2
257-
)
258-
259-
match = _percent_re.match(percent)
260-
if not match or len(match.group())!= len(percent):
261-
raise ValueError(("format() must be given exactly one %%char "
262-
"format specifier, %s not valid") % repr(percent))
263-
return _format(percent, value, grouping, monetary, *additional)
264-
265250
def currency(val, symbol=True, grouping=False, international=False):
266251
"""Formats val according to the currency settings
267252
in the current locale."""

0 commit comments

Comments
 (0)