mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-104922: Make PY_SSIZE_T_CLEAN
not mandatory again (#105051)
This commit is contained in:
parent
f90d3f68db
commit
adccff3b3f
15 changed files with 105 additions and 397 deletions
|
@ -901,23 +901,6 @@ class String_TestCase(unittest.TestCase):
|
|||
self.assertRaises(TypeError, getargs_s_hash, memoryview(b'memoryview'))
|
||||
self.assertRaises(TypeError, getargs_s_hash, None)
|
||||
|
||||
def test_s_hash_int(self):
|
||||
# "s#" without PY_SSIZE_T_CLEAN defined.
|
||||
from _testcapi import getargs_s_hash_int
|
||||
from _testcapi import getargs_s_hash_int2
|
||||
buf = bytearray([1, 2])
|
||||
self.assertRaises(SystemError, getargs_s_hash_int, buf, "abc")
|
||||
self.assertRaises(SystemError, getargs_s_hash_int, buf, x=42)
|
||||
self.assertRaises(SystemError, getargs_s_hash_int, buf, x="abc")
|
||||
self.assertRaises(SystemError, getargs_s_hash_int2, buf, ("abc",))
|
||||
self.assertRaises(SystemError, getargs_s_hash_int2, buf, x=42)
|
||||
self.assertRaises(SystemError, getargs_s_hash_int2, buf, x="abc")
|
||||
buf.append(3) # still mutable -- not locked by a buffer export
|
||||
# getargs_s_hash_int(buf) may not raise SystemError because skipitem()
|
||||
# is not called. But it is an implementation detail.
|
||||
# getargs_s_hash_int(buf)
|
||||
# getargs_s_hash_int2(buf)
|
||||
|
||||
def test_z(self):
|
||||
from _testcapi import getargs_z
|
||||
self.assertEqual(getargs_z('abc\xe9'), b'abc\xc3\xa9')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue