mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
[3.10] bpo-46584: remove check for py2.3
from ctypes/test_python_api
(GH-31024) (GH-31054)
(cherry picked from commit 913e340a32
)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
parent
1dcd772804
commit
8765b01bcf
1 changed files with 2 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
|||
from ctypes import *
|
||||
import unittest, sys
|
||||
import unittest
|
||||
from test import support
|
||||
|
||||
################################################################
|
||||
|
@ -10,10 +10,6 @@ from _ctypes import PyObj_FromPtr
|
|||
################################################################
|
||||
|
||||
from sys import getrefcount as grc
|
||||
if sys.version_info > (2, 4):
|
||||
c_py_ssize_t = c_size_t
|
||||
else:
|
||||
c_py_ssize_t = c_int
|
||||
|
||||
class PythonAPITestCase(unittest.TestCase):
|
||||
|
||||
|
@ -21,7 +17,7 @@ class PythonAPITestCase(unittest.TestCase):
|
|||
PyBytes_FromStringAndSize = pythonapi.PyBytes_FromStringAndSize
|
||||
|
||||
PyBytes_FromStringAndSize.restype = py_object
|
||||
PyBytes_FromStringAndSize.argtypes = c_char_p, c_py_ssize_t
|
||||
PyBytes_FromStringAndSize.argtypes = c_char_p, c_size_t
|
||||
|
||||
self.assertEqual(PyBytes_FromStringAndSize(b"abcdefghi", 3), b"abc")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue