Skip to content

Commit

Permalink
bpo-35523: Remove ctypes callback workaround (GH-11211)
Browse files Browse the repository at this point in the history
Remove ctypes callback workaround: no longer create a callback at startup.
Avoid SELinux alert on "import ctypes" and "import uuid".
  • Loading branch information
vstinner committed Dec 18, 2018
1 parent 3fcc1e0 commit e6b247c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 0 additions & 5 deletions Lib/ctypes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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``.

0 comments on commit e6b247c

Please sign in to comment.