churchyard / rpms / python3

Forked from rpms/python3 3 years ago
Clone

Blame 00155-avoid-ctypes-thunks.patch

bae5e50
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
256657e
From: David Malcolm <dmalcolm@redhat.com>
256657e
Date: Fri, 19 Jun 2020 16:02:24 +0200
256657e
Subject: [PATCH] 00155: avoid allocating thunks in ctypes unless absolutely
256657e
 necessary
256657e
256657e
Avoid allocating thunks in ctypes unless absolutely necessary, to avoid
256657e
generating SELinux denials on "import ctypes" and "import uuid" when
256657e
embedding Python within httpd
256657e
See https://bugzilla.redhat.com/show_bug.cgi?id=814391
256657e
---
256657e
 Lib/ctypes/__init__.py | 5 -----
256657e
 1 file changed, 5 deletions(-)
256657e
256657e
diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py
256657e
index dae408a867..f4178c0731 100644
256657e
--- a/Lib/ctypes/__init__.py
256657e
+++ b/Lib/ctypes/__init__.py
256657e
@@ -266,11 +266,6 @@ def _reset_cache():
8a28107
     # _SimpleCData.c_char_p_from_param
8a28107
     POINTER(c_char).from_param = c_char_p.from_param
8a28107
     _pointer_type_cache[None] = c_void_p
8a28107
-    # XXX for whatever reasons, creating the first instance of a callback
8a28107
-    # function is needed for the unittests on Win64 to succeed.  This MAY
8a28107
-    # be a compiler bug, since the problem occurs only when _ctypes is
8a28107
-    # compiled with the MS SDK compiler.  Or an uninitialized variable?
8a28107
-    CFUNCTYPE(c_int)(lambda: None)
8a28107
 
8a28107
 def create_unicode_buffer(init, size=None):
8a28107
     """create_unicode_buffer(aString) -> character array