diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-09-25 21:55:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-25 21:55:55 (GMT) |
commit | 81108375d9b2ccd0add1572da745311d4dfac505 (patch) | |
tree | 54632e1d6ec58850f70941452634c4faf1ea7218 /Lib/locale.py | |
parent | f1502d097c29b266a5748312ee2451a2d6ac0af6 (diff) | |
download | cpython-81108375d9b2ccd0add1572da745311d4dfac505.zip cpython-81108375d9b2ccd0add1572da745311d4dfac505.tar.gz cpython-81108375d9b2ccd0add1572da745311d4dfac505.tar.bz2 |
bpo-30152: Reduce the number of imports for argparse. (#1269)
Diffstat (limited to 'Lib/locale.py')
-rw-r--r-- | Lib/locale.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/locale.py b/Lib/locale.py index 569fe85..f1d157d 100644 --- a/Lib/locale.py +++ b/Lib/locale.py @@ -14,10 +14,9 @@ import sys import encodings import encodings.aliases import re -import collections.abc +import _collections_abc from builtins import str as _builtin_str import functools -import warnings # Try importing the _locale module. # @@ -215,7 +214,7 @@ def format_string(f, val, grouping=False, monetary=False): percents = list(_percent_re.finditer(f)) new_f = _percent_re.sub('%s', f) - if isinstance(val, collections.abc.Mapping): + if isinstance(val, _collections_abc.Mapping): new_val = [] for perc in percents: if perc.group()[-1]=='%': @@ -244,6 +243,7 @@ def format_string(f, val, grouping=False, monetary=False): def format(percent, value, grouping=False, monetary=False, *additional): """Deprecated, use format_string instead.""" + import warnings warnings.warn( "This method will be removed in a future version of Python. " "Use 'locale.format_string()' instead.", |