Skip to content

Commit e6b247c

Browse files
authored
bpo-35523: Remove ctypes callback workaround (pythonGH-11211)
Remove ctypes callback workaround: no longer create a callback at startup. Avoid SELinux alert on "import ctypes" and "import uuid".
1 parent 3fcc1e0 commit e6b247c

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

Lib/ctypes/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,6 @@ def _reset_cache():
266266
# _SimpleCData.c_char_p_from_param
267267
POINTER(c_char).from_param = c_char_p.from_param
268268
_pointer_type_cache[None] = c_void_p
269-
# XXX for whatever reasons, creating the first instance of a callback
270-
# function is needed for the unittests on Win64 to succeed. This MAY
271-
# be a compiler bug, since the problem occurs only when _ctypes is
272-
# compiled with the MS SDK compiler. Or an uninitialized variable?
273-
CFUNCTYPE(c_int)(lambda: None)
274269

275270
def create_unicode_buffer(init, size=None):
276271
"""create_unicode_buffer(aString) -> character array
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Remove :mod:`ctypes` callback workaround: no longer create a callback at
2+
startup. Avoid SELinux alert on ``import ctypes`` and ``import uuid``.

0 commit comments

Comments
 (0)