FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-153903: Use `@ctypes.util.wrap_dll_function()` with pythonapi by vstinner · Pull Request #154030 · python/cpython · GitHub

Repository navigation

gh-153903: Use @ctypes.util.wrap_dll_function() with pythonapi - #154030

Merged
vstinner merged 5 commits into
python:mainfrom
vstinner:ctypes_wrap
Jul 19, 2026
Merged

vstinner merged 5 commits into
python:mainfrom
vstinner:ctypes_wrap

Conversation

vstinner commented Jul 18, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

Use the @ctypes.util.wrap_dll_function() decorator with ctypes.pythonapi to wrap Python C API functions in the test suite.

Use the @ctypes.util.wrap_dll_function() decorator with
ctypes.pythonapi to wrap Python C API functions in the test suite.

Copy link
Copy Markdown
Member Author

cc @ZeroIntensity

ZeroIntensity left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The readability improvement is really nice

Comment thread Lib/test/test_capi/test_misc.py Outdated

Copy link
Copy Markdown
Member Author

The readability improvement is really nice

Readability is nice, but my first motivation is correctness. The new syntax reduces the risk of typo when declaring a ctypes function.

vstinner enabled auto-merge (squash) July 19, 2026 10:14

Copy link
Copy Markdown
Member Author

Tests / Windows / Build and test (x64, switch-case) (pull_request)Failing after 21m

Ah, test_logging failed. I just re-ran the job.

FAIL: test_rollover_at_midnight (test.test_logging.TimedRotatingFileHandlerTest.test_rollover_at_midnight)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\test_logging.py", line 6749, in test_rollover_at_midnight
    self.assertIn(f'testing2 {i}', line)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 'testing2 0' not found in '2026-07-19 11:25:12,102 testing1 0\n'

vstinner merged commit 84897d2 into python:main Jul 19, 2026
87 of 89 checks passed
vstinner deleted the ctypes_wrap branch July 19, 2026 12:04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL