8000 bpo-46584: remove check for `py2.3` from `ctypes/test_python_api` by sobolevn · Pull Request #31024 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-46584: remove check for py2.3 from ctypes/test_python_api #31024

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 1, 2022
Merged
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
8 changes: 2 additions & 6 deletions Lib/ctypes/test/test_python_api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from ctypes import *
import unittest, sys
import unittest
from test import support

################################################################
Expand All @@ -10,18 +10,14 @@
################################################################

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):

def test_PyBytes_FromStringAndSize(self):
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")

Expand Down
0