mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
Remove __unicode__ method so that `unicode(BaseException)
` succeeds.
Fixes bug #1551432.
This commit is contained in:
parent
b3304c129f
commit
19d76c5aa8
4 changed files with 13 additions and 19 deletions
|
@ -304,6 +304,15 @@ class ExceptionTests(unittest.TestCase):
|
|||
return -1
|
||||
self.assertRaises(RuntimeError, g)
|
||||
|
||||
def testUnicodeStrUsage(self):
|
||||
# Make sure both instances and classes have a str and unicode
|
||||
# representation.
|
||||
self.failUnless(str(Exception))
|
||||
self.failUnless(unicode(Exception))
|
||||
self.failUnless(str(Exception('a')))
|
||||
self.failUnless(unicode(Exception(u'a')))
|
||||
|
||||
|
||||
def test_main():
|
||||
run_unittest(ExceptionTests)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue