summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_long.py
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-01-20 20:45:53 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2009-01-20 20:45:53 (GMT)
commit9ffc0205a62972fa8faaf2d4577d3a3efaeb80d9 (patch)
tree15f9a3c2658cdbe9a1e36101b379a7c6d4620be4 /Lib/test/test_long.py
parent8dd05147d6224f4982ef6b14d904bb600ef33ea3 (diff)
downloadcpython-9ffc0205a62972fa8faaf2d4577d3a3efaeb80d9.zip
cpython-9ffc0205a62972fa8faaf2d4577d3a3efaeb80d9.tar.gz
cpython-9ffc0205a62972fa8faaf2d4577d3a3efaeb80d9.tar.bz2
Issue 4842, patch 2/2: int('3L') should be invalid in Python 3.x.
Diffstat (limited to 'Lib/test/test_long.py')
-rw-r--r--Lib/test/test_long.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py
index ed8c886..c1f8b5c 100644
--- a/Lib/test/test_long.py
+++ b/Lib/test/test_long.py
@@ -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