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

gh-104533: Fix ctypes test_pointer_proto_missing_argtypes_error() by vstinner · Pull Request #154169 · python/cpython · GitHub

Repository navigation

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
Next Next commit
gh-104533: Fix ctypes test_pointer_proto_missing_argtypes_error()
Save/restore Py_GetVersion.argtypes, since Py_GetVersion is used in
another test.
  • Loading branch information
vstinner committed Jul 19, 2026
commit bea6a44f85e18ee2a63f05f6ae60a750e0de6609
8 changes: 4 additions & 4 deletions Lib/test/test_ctypes/test_pointers.py
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
c_long, c_ulong, c_longlong, c_ulonglong,
c_float, c_double)
from ctypes import _pointer_type_cache, _pointer_type_cache_fallback
from test import support
from test.support import import_helper
from weakref import WeakSet
_ctypes_test = import_helper.import_module("_ctypes_test")
Expand Down Expand Up @@ -409,10 +410,9 @@ class BadType(ctypes._Pointer):
pass

func = ctypes.pythonapi.Py_GetVersion
func.argtypes = (BadType,)

with self.assertRaises(ctypes.ArgumentError):
func(object())
with support.swap_attr(func, 'argtypes', (BadType,)):
with self.assertRaises(ctypes.ArgumentError):
func(object())

class PointerTypeCacheTestCase(unittest.TestCase):
# dummy tests to check warnings and base behavior
Expand Down
Loading

Back | FazBrowse Home | New Git URL