Changes in anticipation of stricter str vs. bytes enforcement.

This commit is contained in:
Guido van Rossum 2007-08-27 18:31:48 +00:00
parent 35d9428046
commit 9c62772d5e
7 changed files with 57 additions and 50 deletions

View file

@ -794,10 +794,10 @@ class UnicodeTest(
self.assertEqual(b"\\N{foo}xx".decode("unicode-escape", "ignore"), "xx")
# Error handling (truncated escape sequence)
self.assertRaises(UnicodeError, "\\".decode, "unicode-escape")
self.assertRaises(UnicodeError, b"\\".decode, "unicode-escape")
self.assertRaises(TypeError, "hello".decode, "test.unicode1")
self.assertRaises(TypeError, str, "hello", "test.unicode2")
self.assertRaises(TypeError, b"hello".decode, "test.unicode1")
self.assertRaises(TypeError, str, b"hello", "test.unicode2")
self.assertRaises(TypeError, "hello".encode, "test.unicode1")
self.assertRaises(TypeError, "hello".encode, "test.unicode2")
# executes PyUnicode_Encode()