Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-133866: remove deprecated and undocumented function ctypes.SetPointerType #133869

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

Merged
7 changes: 7 additions & 0 deletions 7 Doc/whatsnew/3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ Deprecated
Removed
=======

ctypes
------

* The undocumented function :func:`!ctypes.SetPointerType`.
(Contributed by Bénédikt Tran in :gh:`133866`.)
picnixz marked this conversation as resolved.
Show resolved Hide resolved


sysconfig
---------

Expand Down
6 changes: 0 additions & 6 deletions 6 Lib/ctypes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 3 additions & 6 deletions 9 Lib/test/test_ctypes/test_incomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ class cell(Structure):
_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)

Expand All @@ -50,10 +48,9 @@ class cell(Structure):
_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()
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Remove the undocumented function :func:`!ctypes.SetPointerType`.
picnixz marked this conversation as resolved.
Show resolved Hide resolved
Patch by Bénédikt Tran.
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.