Skip to content

Commit 577103e

Browse files
committed
Fix windows cert store import in pythonfiles.
Add libb2 to dependencies of Python. Simplify mingw conditions.
1 parent 75a15a3 commit 577103e

File tree

7 files changed

+12
-8
lines changed

7 files changed

+12
-8
lines changed

.github/workflows/mingw.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
${{ matrix.prefix }}-toolchain
4747
${{ matrix.prefix }}-expat
4848
${{ matrix.prefix }}-bzip2
49+
${{ matrix.prefix }}-libb2
4950
${{ matrix.prefix }}-libffi
5051
${{ matrix.prefix }}-mpdecimal
5152
${{ matrix.prefix }}-ncurses

Lib/compileall.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def _walk_dir(dir, maxlevels, quiet=0):
3838
if name == '__pycache__':
3939
continue
4040
fullname = os.path.join(dir, name)
41-
if sys.version.find("MINGW") >= 0:
41+
if 'mingw' in sys.version.lower():
4242
fullname = fullname.replace('\\','/')
4343
if not os.path.isdir(fullname):
4444
yield fullname

Lib/ctypes/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -475,10 +475,11 @@ def LoadLibrary(self, name):
475475
cdll = LibraryLoader(CDLL)
476476
pydll = LibraryLoader(PyDLL)
477477

478-
if _os.name == "nt" and _sys.version.find('MINGW') >= 0:
479-
pythonapi = PyDLL("libpython%d.%d%s.dll" % (_sys.version_info[:2] + (_sys.abiflags,)), None)
480-
elif _os.name == "nt":
481-
pythonapi = PyDLL("python.dll", None, _sys.dllhandle)
478+
if _os.name == "nt":
479+
if 'mingw' in sys.version.lower():
480+
pythonapi = PyDLL("libpython%d.%d%s.dll" % (_sys.version_info[:2] + (_sys.abiflags,)), None)
481+
else:
482+
pythonapi = PyDLL("python.dll", None, _sys.dllhandle)
482483
elif _sys.platform == "android":
483484
pythonapi = PyDLL("libpython%d.%d.so" % _sys.version_info[:2])
484485
elif _sys.platform == "cygwin":

Lib/site.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ def getsitepackages(prefixes=None):
434434
abi_thread = 't'
435435
else:
436436
abi_thread = ''
437-
if os.name == 'posix' or (os.name == "nt" and 'mingw' in sys.version.lower()):
437+
if os.name == 'posix' or 'mingw' in sys.version.lower():
438438
libdirs = [sys.platlibdir]
439439
if sys.platlibdir != "lib":
440440
libdirs.append("lib")

Lib/ssl.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ class _TLSMessageType:
254254
CHANGE_CIPHER_SPEC = 0x0101
255255

256256

257-
if sys.platform == "win32" and sys.version.find("MINGW") == -1:
257+
if sys.platform == "win32":
258258
from _ssl import enum_certificates, enum_crls
259259

260260
from socket import socket, SOCK_STREAM, create_connection
@@ -528,7 +528,7 @@ def _load_windows_store_certs(self, storename, purpose):
528528
def load_default_certs(self, purpose=Purpose.SERVER_AUTH):
529529
if not isinstance(purpose, _ASN1Object):
530530
raise TypeError(purpose)
531-
if sys.platform == "win32" and sys.version.find("MINGW") == -1:
531+
if sys.platform == "win32":
532532
for storename in self._windows_cert_stores:
533533
self._load_windows_store_certs(storename, purpose)
534534
self.set_default_verify_paths()

Lib/sysconfig/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
'include': '{installed_base}/Include',
5757
'platinclude': '{installed_base}/Include',
5858
'scripts': '{base}/Scripts',
59+
'data': '{base}',
5960
},
6061

6162
# Downstream distributors can overwrite the default install scheme.

Modules/getpath.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ def _normpath(p):
285285
if py_setpath:
286286
# When Py_SetPath has been called, executable defaults to
287287
# the real executable path.
288+
288289
if not executable:
289290
executable = real_executable
290291

0 commit comments

Comments
 (0)