Skip to content

Commit

Permalink
bpo-46584: remove check for py2.3 from ctypes/test_python_api (GH…
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Feb 1, 2022
1 parent 0515eaf commit 913e340
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Lib/ctypes/test/test_python_api.py
@@ -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 comments on commit 913e340

Please sign in to comment.