mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Changes in anticipation of stricter str vs. bytes enforcement.
This commit is contained in:
parent
35d9428046
commit
9c62772d5e
7 changed files with 57 additions and 50 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue