mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Revert previous checkin on getargs 'L' code. Try to convert all
numbers in PyLong_AsLongLong, and update test suite accordingly. Backported to 2.4.
This commit is contained in:
parent
4bf108d74f
commit
6ce7ed23d0
4 changed files with 27 additions and 25 deletions
|
@ -187,16 +187,10 @@ class LongLong_TestCase(unittest.TestCase):
|
|||
def test_L(self):
|
||||
from _testcapi import getargs_L
|
||||
# L returns 'long long', and does range checking (LLONG_MIN ... LLONG_MAX)
|
||||
|
||||
# XXX There's a bug in getargs.c, format code "L":
|
||||
# If you pass something else than a Python long, you
|
||||
# get "Bad argument to internal function".
|
||||
|
||||
# So these three tests are commented out:
|
||||
|
||||
## self.failUnlessEqual(3, getargs_L(3.14))
|
||||
## self.failUnlessEqual(99, getargs_L(Long()))
|
||||
## self.failUnlessEqual(99, getargs_L(Int()))
|
||||
self.failUnlessRaises(TypeError, getargs_L, "Hello")
|
||||
self.failUnlessEqual(3, getargs_L(3.14))
|
||||
self.failUnlessEqual(99, getargs_L(Long()))
|
||||
self.failUnlessEqual(99, getargs_L(Int()))
|
||||
|
||||
self.assertRaises(OverflowError, getargs_L, LLONG_MIN-1)
|
||||
self.failUnlessEqual(LLONG_MIN, getargs_L(LLONG_MIN))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue