mirror of
https://github.com/python/cpython.git
synced 2025-07-07 11:25:30 +00:00
gh-133866: remove deprecated and undocumented function ctypes.SetPointerType
(GH-133869)
This commit is contained in:
parent
b783e1791b
commit
cafbcd666a
4 changed files with 14 additions and 12 deletions
|
@ -138,6 +138,14 @@ Deprecated
|
|||
Removed
|
||||
=======
|
||||
|
||||
ctypes
|
||||
------
|
||||
|
||||
* Removed the undocumented function :func:`!ctypes.SetPointerType`,
|
||||
which has been deprecated since Python 3.13.
|
||||
(Contributed by Bénédikt Tran in :gh:`133866`.)
|
||||
|
||||
|
||||
http.server
|
||||
-----------
|
||||
|
||||
|
|
|
@ -379,12 +379,6 @@ def create_unicode_buffer(init, size=None):
|
|||
return buf
|
||||
raise TypeError(init)
|
||||
|
||||
|
||||
def SetPointerType(pointer, cls):
|
||||
import warnings
|
||||
warnings._deprecated("ctypes.SetPointerType", remove=(3, 15))
|
||||
pointer.set_type(cls)
|
||||
|
||||
def ARRAY(typ, len):
|
||||
return typ * len
|
||||
|
||||
|
|
|
@ -21,9 +21,7 @@ class TestSetPointerType(unittest.TestCase):
|
|||
_fields_ = [("name", c_char_p),
|
||||
("next", lpcell)]
|
||||
|
||||
with warnings.catch_warnings():
|
||||
warnings.simplefilter('ignore', DeprecationWarning)
|
||||
ctypes.SetPointerType(lpcell, cell)
|
||||
lpcell.set_type(cell)
|
||||
|
||||
self.assertIs(POINTER(cell), lpcell)
|
||||
|
||||
|
@ -50,10 +48,9 @@ class TestSetPointerType(unittest.TestCase):
|
|||
_fields_ = [("name", c_char_p),
|
||||
("next", lpcell)]
|
||||
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
ctypes.SetPointerType(lpcell, cell)
|
||||
|
||||
lpcell.set_type(cell)
|
||||
self.assertIs(POINTER(cell), lpcell)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
Remove the undocumented function :func:`!ctypes.SetPointerType`,
|
||||
which has been deprecated since Python 3.13.
|
||||
Patch by Bénédikt Tran.
|
Loading…
Add table
Add a link
Reference in a new issue