diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-06-10 16:05:10 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-06-10 16:05:10 (GMT) |
commit | c73013127b2791476ade69d36b69736b9caa674c (patch) | |
tree | fa53dc8035ac44a9b1bb73d06ed964928a4a9919 /Lib | |
parent | 37296e89a5119eb3af8344796ce653b2d89e403a (diff) | |
download | cpython-c73013127b2791476ade69d36b69736b9caa674c.zip cpython-c73013127b2791476ade69d36b69736b9caa674c.tar.gz cpython-c73013127b2791476ade69d36b69736b9caa674c.tar.bz2 |
Issue #8950: Make PyArg_Parse* with 'L' code raise for float inputs,
instead of warning. This makes it consistent with the other integer
codes.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_getargs2.py | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/Lib/test/test_getargs2.py b/Lib/test/test_getargs2.py index 7fa5983..baf70d1 100644 --- a/Lib/test/test_getargs2.py +++ b/Lib/test/test_getargs2.py @@ -1,7 +1,6 @@ import unittest from test import support from _testcapi import getargs_keywords -import warnings """ > How about the following counterproposal. This also changes some of @@ -190,21 +189,7 @@ class LongLong_TestCase(unittest.TestCase): from _testcapi import getargs_L # L returns 'long long', and does range checking (LLONG_MIN # ... LLONG_MAX) - with warnings.catch_warnings(): - warnings.filterwarnings( - "ignore", - category=DeprecationWarning, - message=".*integer argument expected, got float", - module=__name__) - self.assertEqual(3, getargs_L(3.14)) - with warnings.catch_warnings(): - warnings.filterwarnings( - "error", - category=DeprecationWarning, - message=".*integer argument expected, got float", - module="unittest") - self.assertRaises(DeprecationWarning, getargs_L, 3.14) - + self.assertRaises(TypeError, getargs_L, 3.14) self.assertRaises(TypeError, getargs_L, "Hello") self.assertEqual(99, getargs_L(Int())) |