]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-35523: Remove ctypes callback workaround (GH-11211)
authorVictor Stinner <vstinner@redhat.com>
Tue, 18 Dec 2018 13:47:21 +0000 (14:47 +0100)
committerGitHub <noreply@github.com>
Tue, 18 Dec 2018 13:47:21 +0000 (14:47 +0100)
Remove ctypes callback workaround: no longer create a callback at startup.
Avoid SELinux alert on "import ctypes" and "import uuid".

Lib/ctypes/__init__.py
Misc/NEWS.d/next/Library/2018-12-18-13-52-13.bpo-35523.SkoMno.rst [new file with mode: 0644]

index 614677398864821711d3606a200f4a783e209aa7..5f78beda5866ef1d1ab1b89ac8504b34c61c2f7b 100644 (file)
@@ -266,11 +266,6 @@ def _reset_cache():
     # _SimpleCData.c_char_p_from_param
     POINTER(c_char).from_param = c_char_p.from_param
     _pointer_type_cache[None] = c_void_p
-    # XXX for whatever reasons, creating the first instance of a callback
-    # function is needed for the unittests on Win64 to succeed.  This MAY
-    # be a compiler bug, since the problem occurs only when _ctypes is
-    # compiled with the MS SDK compiler.  Or an uninitialized variable?
-    CFUNCTYPE(c_int)(lambda: None)
 
 def create_unicode_buffer(init, size=None):
     """create_unicode_buffer(aString) -> character array
diff --git a/Misc/NEWS.d/next/Library/2018-12-18-13-52-13.bpo-35523.SkoMno.rst b/Misc/NEWS.d/next/Library/2018-12-18-13-52-13.bpo-35523.SkoMno.rst
new file mode 100644 (file)
index 0000000..94a9fd2
--- /dev/null
@@ -0,0 +1,2 @@
+Remove :mod:`ctypes` callback workaround: no longer create a callback at
+startup. Avoid SELinux alert on ``import ctypes`` and ``import uuid``.