This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Modernize `ctypes/test_python_api` by removing old version check
Type: behavior Stage: resolved
Components: ctypes, Tests Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, belopolsky, meador.inge, miss-islington, sobolevn, zach.ware
Priority: normal Keywords: patch

Created on 2022-01-30 14:56 by sobolevn, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 31024 merged sobolevn, 2022-01-30 14:57
PR 31053 merged miss-islington, 2022-02-01 14:08
PR 31054 merged miss-islington, 2022-02-01 14:08
Messages (5)
msg412154 - (view) Author: Nikita Sobolev (sobolevn) * (Python triager) Date: 2022-01-30 14:56
Right now Lib/ctypes/test/test_python_api.py has these lines:

```
if sys.version_info > (2, 4):
    c_py_ssize_t = c_size_t
else:
    c_py_ssize_t = c_int
```

Source: https://github.com/python/cpython/blame/8fb36494501aad5b0c1d34311c9743c60bb9926c/Lib/ctypes/test/test_python_api.py#L13-L16

I think that there's no reason to keep code compat for python versions `<=2.3`. Other modules in CPython do refactor this by removing old and unused code, especially in tests.

I propose to do the same here.
msg412262 - (view) Author: miss-islington (miss-islington) Date: 2022-02-01 13:56
New changeset 913e340a323c7e61ae6e4acbb1312b4342657bec by Nikita Sobolev in branch 'main':
bpo-46584: remove check for `py2.3` from `ctypes/test_python_api` (GH-31024)
https://github.com/python/cpython/commit/913e340a323c7e61ae6e4acbb1312b4342657bec
msg412267 - (view) Author: miss-islington (miss-islington) Date: 2022-02-01 14:42
New changeset 8765b01bcf6514602affcca66e7deeeb998f9cef by Miss Islington (bot) in branch '3.10':
[3.10] bpo-46584: remove check for `py2.3` from `ctypes/test_python_api` (GH-31024) (GH-31054)
https://github.com/python/cpython/commit/8765b01bcf6514602affcca66e7deeeb998f9cef
msg412268 - (view) Author: miss-islington (miss-islington) Date: 2022-02-01 14:42
New changeset 7368ca1b889d7fa16423e69034bf4c5fe7b00268 by Miss Islington (bot) in branch '3.9':
[3.9] bpo-46584: remove check for `py2.3` from `ctypes/test_python_api` (GH-31024) (GH-31053)
https://github.com/python/cpython/commit/7368ca1b889d7fa16423e69034bf4c5fe7b00268
msg412269 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2022-02-01 14:43
Thanks for the patch!
History
Date User Action Args
2022-04-11 14:59:55adminsetgithub: 90742
2022-02-01 14:43:29zach.waresetstatus: open -> closed
resolution: fixed
messages: + msg412269

stage: patch review -> resolved
2022-02-01 14:42:53miss-islingtonsetmessages: + msg412268
2022-02-01 14:42:45miss-islingtonsetmessages: + msg412267
2022-02-01 14:08:50miss-islingtonsetpull_requests: + pull_request29236
2022-02-01 14:08:44miss-islingtonsetpull_requests: + pull_request29235
2022-02-01 13:56:33miss-islingtonsetnosy: + miss-islington
messages: + msg412262
2022-01-30 14:57:30sobolevnsetkeywords: + patch
stage: patch review
pull_requests: + pull_request29205
2022-01-30 14:56:00sobolevncreate