Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Lib/test/test_unicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
from test import support, string_tests
from test.support.script_helper import assert_python_failure

Py_DEBUG = hasattr(sys, 'gettotalrefcount')


# Error handling (bad decoder return)
def search_function(encoding):
def decode1(input, errors="strict"):
Expand Down Expand Up @@ -2881,9 +2884,10 @@ def test_copycharacters(self):
self.assertRaises(IndexError, unicode_copycharacters, s, -1, s, 0, 5)
self.assertRaises(IndexError, unicode_copycharacters, s, 0, s, 6, 5)
self.assertRaises(IndexError, unicode_copycharacters, s, 0, s, -1, 5)
self.assertRaises(SystemError, unicode_copycharacters, s, 1, s, 0, 5)
self.assertRaises(SystemError, unicode_copycharacters, s, 0, s, 0, -1)
self.assertRaises(SystemError, unicode_copycharacters, s, 0, b'', 0, 0)
if Py_DEBUG:
self.assertRaises(SystemError, unicode_copycharacters, s, 1, s, 0, 5)
self.assertRaises(SystemError, unicode_copycharacters, s, 0, s, 0, -1)
self.assertRaises(SystemError, unicode_copycharacters, s, 0, b'', 0, 0)

@support.cpython_only
def test_encode_decimal(self):
Expand Down
Loading