mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
Issue19995: passing a non-int to %o, %c, %x, or %X now raises an exception
This commit is contained in:
parent
8e5d0caf92
commit
38d872ee5d
5 changed files with 10 additions and 43 deletions
|
@ -1178,8 +1178,7 @@ class MixinStrUnicodeUserStringTest:
|
|||
self.checkraises(TypeError, 'abc', '__mod__')
|
||||
self.checkraises(TypeError, '%(foo)s', '__mod__', 42)
|
||||
self.checkraises(TypeError, '%s%s', '__mod__', (42,))
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
self.checkraises(TypeError, '%c', '__mod__', (None,))
|
||||
self.checkraises(TypeError, '%c', '__mod__', (None,))
|
||||
self.checkraises(ValueError, '%(foo', '__mod__', {})
|
||||
self.checkraises(TypeError, '%(foo)s %(bar)s', '__mod__', ('foo', 42))
|
||||
self.checkraises(TypeError, '%d', '__mod__', "42") # not numeric
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue