[Python-checkins] r74705 - in python/branches/release26-maint: Lib/decimal.py Lib/test/test_decimal.py Misc/NEWS

mark.dickinson python-checkins at python.org
Mon Sep 7 18:19:35 CEST 2009


Author: mark.dickinson
Date: Mon Sep 7 18:19:35 2009
New Revision: 74705
Log:
Merged revisions 74704 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk
........
 r74704 | mark.dickinson | 2009年09月07日 17:17:41 +0100 (2009年9月07日) | 3 lines
 
 Issue #6850: Fix bug in Decimal._parse_format_specifier for formats
 with no type specifier.
........
Modified:
 python/branches/release26-maint/ (props changed)
 python/branches/release26-maint/Lib/decimal.py
 python/branches/release26-maint/Lib/test/test_decimal.py
 python/branches/release26-maint/Misc/NEWS
Modified: python/branches/release26-maint/Lib/decimal.py
==============================================================================
--- python/branches/release26-maint/Lib/decimal.py	(original)
+++ python/branches/release26-maint/Lib/decimal.py	Mon Sep 7 18:19:35 2009
@@ -5447,7 +5447,7 @@
 # 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
 
 # record whether return type should be str or unicode
Modified: python/branches/release26-maint/Lib/test/test_decimal.py
==============================================================================
--- python/branches/release26-maint/Lib/test/test_decimal.py	(original)
+++ python/branches/release26-maint/Lib/test/test_decimal.py	Mon Sep 7 18:19:35 2009
@@ -716,6 +716,9 @@
 ('>6', '123', ' 123'),
 ('^6', '123', ' 123 '),
 ('=+6', '123', '+ 123'),
+
+ # issue 6850
+ ('a=-7.0', '0.12345', 'aaaa0.1'),
 ]
 for fmt, d, result in test_values:
 self.assertEqual(format(Decimal(d), fmt), result)
Modified: python/branches/release26-maint/Misc/NEWS
==============================================================================
--- python/branches/release26-maint/Misc/NEWS	(original)
+++ python/branches/release26-maint/Misc/NEWS	Mon Sep 7 18:19:35 2009
@@ -74,6 +74,9 @@
 Library
 -------
 
+- Issue #6850: Fix bug in Decimal._parse_format_specifier for formats
+ with no type specifier.
+
 - Issue #4937: plat-mac/bundlebuilder revers to non-existing version.plist
 
 - Issue #6838: Use a list to accumulate the value instead of


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /