diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-09-07 16:17:41 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-09-07 16:17:41 (GMT) |
commit | 491ea55f2866cc0b4fee036069fc07748920b0cf (patch) | |
tree | 38391ebf58ed20617054956b618a39af7d353ff7 /Lib/decimal.py | |
parent | d692a71fddbbc8cebabf260e7d11e113cff4f73e (diff) | |
download | cpython-491ea55f2866cc0b4fee036069fc07748920b0cf.zip cpython-491ea55f2866cc0b4fee036069fc07748920b0cf.tar.gz cpython-491ea55f2866cc0b4fee036069fc07748920b0cf.tar.bz2 |
Issue #6850: Fix bug in Decimal._parse_format_specifier for formats
with no type specifier.
Diffstat (limited to 'Lib/decimal.py')
-rw-r--r-- | Lib/decimal.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py index e786453..1f5c920 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py @@ -5512,7 +5512,7 @@ def _parse_format_specifier(format_spec, _localeconv=None): # if format type is 'g' or 'G' then a precision of 0 makes little # sense; convert it to 1. Same if format type is unspecified. if format_dict['precision'] == 0: - if format_dict['type'] in 'gG' or format_dict['type'] is None: + if format_dict['type'] is None or format_dict['type'] in 'gG': format_dict['precision'] = 1 # determine thousands separator, grouping, and decimal separator, and |