mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
SF#1391872
Floating point literals don't work in non-US locale in 2.5. Patch and new locale tests by Hye-Shik Chang.
This commit is contained in:
parent
b9359c402b
commit
24f0fa97c5
2 changed files with 14 additions and 2 deletions
|
@ -97,6 +97,18 @@ class _LocaleTests(unittest.TestCase):
|
|||
loc, set_locale))
|
||||
|
||||
|
||||
def test_float_parsing(self):
|
||||
# Bug #1391872: Test whether float parsing is okay on European
|
||||
# locales.
|
||||
for loc in candidate_locales:
|
||||
try:
|
||||
setlocale(LC_NUMERIC, loc)
|
||||
except Error:
|
||||
continue
|
||||
self.assertEquals(int(eval('3.14') * 100), 314)
|
||||
self.assertEquals(int(float('3.14') * 100), 314)
|
||||
|
||||
|
||||
|
||||
def test_main():
|
||||
run_unittest(_LocaleTests)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue