summarylogtreecommitdiffstats
path: root/0049-ctypes-python-dll.patch
diff options
context:
space:
mode:
authoratomlong2021-10-23 17:55:22 +0800
committeratomlong2021-10-23 18:06:15 +0800
commit80096c8de4b34ec1ed8f30bb428918cd592b2424 (patch)
treeb48dd1e73de9ea35a4709fb6b93deb16331ec514 /0049-ctypes-python-dll.patch
parent89a67c05174951d172252b1db96ff93cc4ec4bcd (diff)
downloadaur-mingw-w64-python.tar.gz
update to 3.9.7
Diffstat (limited to '0049-ctypes-python-dll.patch')
-rw-r--r--0049-ctypes-python-dll.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/0049-ctypes-python-dll.patch b/0049-ctypes-python-dll.patch
new file mode 100644
index 000000000000..158470a4d174
--- /dev/null
+++ b/0049-ctypes-python-dll.patch
@@ -0,0 +1,33 @@
+From 2a0f9b8311884449312bb934557f43a93a7ab426 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?=
+ <alexey.pawlow@gmail.com>
+Date: Thu, 17 Jun 2021 18:52:01 +0530
+Subject: [PATCH 049/N] ctypes python dll
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Co-authored-by: Алексей <alexey.pawlow@gmail.com>
+Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
+---
+ Lib/ctypes/__init__.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py
+index 4afa4eb..2fe2eec 100644
+--- a/Lib/ctypes/__init__.py
++++ b/Lib/ctypes/__init__.py
+@@ -456,7 +456,9 @@ class LibraryLoader(object):
+ cdll = LibraryLoader(CDLL)
+ pydll = LibraryLoader(PyDLL)
+
+-if _os.name == "nt":
++if _os.name == "nt" and _sys.version.find('GCC') >= 0:
++ pythonapi = PyDLL("libpython%d.%d%s.dll" % (_sys.version_info[:2] + (_sys.abiflags,)), None)
++elif _os.name == "nt":
+ pythonapi = PyDLL("python dll", None, _sys.dllhandle)
+ elif _sys.platform == "cygwin":
+ pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2])
+--
+2.33.0
+