mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue 4842, patch 2/2: int('3L') should be invalid in Python 3.x.
This commit is contained in:
parent
8dd05147d6
commit
9ffc0205a6
3 changed files with 13 additions and 2 deletions
|
@ -284,6 +284,16 @@ class LongTest(unittest.TestCase):
|
|||
|
||||
self.assertRaises(ValueError, int, '123\0')
|
||||
self.assertRaises(ValueError, int, '53', 40)
|
||||
# trailing L should no longer be accepted...
|
||||
self.assertRaises(ValueError, int, '123L')
|
||||
self.assertRaises(ValueError, int, '123l')
|
||||
self.assertRaises(ValueError, int, '0L')
|
||||
self.assertRaises(ValueError, int, '-37L')
|
||||
self.assertRaises(ValueError, int, '0x32L', 16)
|
||||
self.assertRaises(ValueError, int, '1L', 21)
|
||||
# ... but it's just a normal digit if base >= 22
|
||||
self.assertEqual(int('1L', 22), 43)
|
||||
|
||||
self.assertRaises(TypeError, int, 1, 12)
|
||||
|
||||
# SF patch #1638879: embedded NULs were not detected with
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue