at master 1.9 kB view raw
1From e6b247c8e524dbe5fc03b3492f628d0d5348bc49 Mon Sep 17 00:00:00 2001 2From: Victor Stinner <vstinner@redhat.com> 3Date: Tue, 18 Dec 2018 14:47:21 +0100 4Subject: [PATCH] bpo-35523: Remove ctypes callback workaround (GH-11211) 5 6Remove ctypes callback workaround: no longer create a callback at startup. 7Avoid SELinux alert on "import ctypes" and "import uuid". 8--- 9 Lib/ctypes/__init__.py | 5 ----- 10 .../next/Library/2018-12-18-13-52-13.bpo-35523.SkoMno.rst | 2 ++ 11 2 files changed, 2 insertions(+), 5 deletions(-) 12 create mode 100644 Misc/NEWS.d/next/Library/2018-12-18-13-52-13.bpo-35523.SkoMno.rst 13 14diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py 15index 6146773988648..5f78beda5866e 100644 16--- a/Lib/ctypes/__init__.py 17+++ b/Lib/ctypes/__init__.py 18@@ -266,11 +266,6 @@ def _reset_cache(): 19 # _SimpleCData.c_char_p_from_param 20 POINTER(c_char).from_param = c_char_p.from_param 21 _pointer_type_cache[None] = c_void_p 22- # XXX for whatever reasons, creating the first instance of a callback 23- # function is needed for the unittests on Win64 to succeed. This MAY 24- # be a compiler bug, since the problem occurs only when _ctypes is 25- # compiled with the MS SDK compiler. Or an uninitialized variable? 26- CFUNCTYPE(c_int)(lambda: None) 27 28 def create_unicode_buffer(init, size=None): 29 """create_unicode_buffer(aString) -> character array 30diff --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 31new file mode 100644 32index 0000000000000..94a9fd257383e 33--- /dev/null 34+++ b/Misc/NEWS.d/next/Library/2018-12-18-13-52-13.bpo-35523.SkoMno.rst 35@@ -0,0 +1,2 @@ 36+Remove :mod:`ctypes` callback workaround: no longer create a callback at 37+startup. Avoid SELinux alert on ``import ctypes`` and ``import uuid``.