mirror of
https://github.com/python/cpython.git
synced 2025-11-02 19:12:55 +00:00
Bug #1417699: Reject locale-specific decimal point in float()
and atof().
This commit is contained in:
parent
82c276ea33
commit
fcfff0a7fa
4 changed files with 27 additions and 3 deletions
|
|
@ -113,6 +113,9 @@ class _LocaleTests(unittest.TestCase):
|
|||
"using eval('3.14') failed for %s" % loc)
|
||||
self.assertEquals(int(float('3.14') * 100), 314,
|
||||
"using float('3.14') failed for %s" % loc)
|
||||
if localeconv()['decimal_point'] != '.':
|
||||
self.assertRaises(ValueError, float,
|
||||
localeconv()['decimal_point'].join(['1', '23']))
|
||||
|
||||
def test_main():
|
||||
run_unittest(_LocaleTests)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue