Skip to content
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

Modernize ctypes/test_python_api by removing old version check #90742

Closed
sobolevn opened this issue Jan 30, 2022 · 5 comments
Closed

Modernize ctypes/test_python_api by removing old version check #90742

sobolevn opened this issue Jan 30, 2022 · 5 comments
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes tests Tests in the Lib/test dir topic-ctypes type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

BPO 46584
Nosy @amauryfa, @abalkin, @meadori, @zware, @miss-islington, @sobolevn
PRs
  • bpo-46584: remove check for py2.3 from ctypes/test_python_api #31024
  • [3.9] bpo-46584: remove check for py2.3 from ctypes/test_python_api (GH-31024) #31053
  • [3.10] bpo-46584: remove check for py2.3 from ctypes/test_python_api (GH-31024) #31054
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2022-02-01.14:43:29.626>
    created_at = <Date 2022-01-30.14:56:00.111>
    labels = ['type-bug', '3.9', '3.10', '3.11', 'ctypes', 'tests']
    title = 'Modernize `ctypes/test_python_api` by removing old version check'
    updated_at = <Date 2022-02-01.14:43:29.625>
    user = 'https://github.com/sobolevn'

    bugs.python.org fields:

    activity = <Date 2022-02-01.14:43:29.625>
    actor = 'zach.ware'
    assignee = 'none'
    closed = True
    closed_date = <Date 2022-02-01.14:43:29.626>
    closer = 'zach.ware'
    components = ['Tests', 'ctypes']
    creation = <Date 2022-01-30.14:56:00.111>
    creator = 'sobolevn'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46584
    keywords = ['patch']
    message_count = 5.0
    messages = ['412154', '412262', '412267', '412268', '412269']
    nosy_count = 6.0
    nosy_names = ['amaury.forgeotdarc', 'belopolsky', 'meador.inge', 'zach.ware', 'miss-islington', 'sobolevn']
    pr_nums = ['31024', '31053', '31054']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue46584'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    @sobolevn
    Copy link
    Member Author

    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.

    @sobolevn sobolevn added 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes tests Tests in the Lib/test dir topic-ctypes type-bug An unexpected behavior, bug, or error labels Jan 30, 2022
    @miss-islington
    Copy link
    Contributor

    New changeset 913e340 by Nikita Sobolev in branch 'main':
    bpo-46584: remove check for py2.3 from ctypes/test_python_api (GH-31024)
    913e340

    @miss-islington
    Copy link
    Contributor

    New changeset 8765b01 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)
    8765b01

    @miss-islington
    Copy link
    Contributor

    New changeset 7368ca1 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)
    7368ca1

    @zware
    Copy link
    Member

    zware commented Feb 1, 2022

    Thanks for the patch!

    @zware zware closed this as completed Feb 1, 2022
    @zware zware closed this as completed Feb 1, 2022
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes 3.10 only security fixes 3.11 only security fixes tests Tests in the Lib/test dir topic-ctypes type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants