From 7cbcb6efd9e3b2727bc31748bced511def3727c2 Mon Sep 17 00:00:00 2001 From: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> Date: Mon, 31 Mar 2025 16:54:30 +0200 Subject: [PATCH] GH-131296: Fix parenthesis warnings on Windows-specific code (GH-131905) --- Modules/_ssl.c | 4 ++-- Modules/posixmodule.c | 2 +- PC/launcher2.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 6615d6d0b998..e6bfbe46add9 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -6111,7 +6111,7 @@ _ssl_enum_certificates_impl(PyObject *module, const char *store_name) return PyErr_SetFromWindowsErr(GetLastError()); } - while (pCertCtx = CertEnumCertificatesInStore(hCollectionStore, pCertCtx)) { + while ((pCertCtx = CertEnumCertificatesInStore(hCollectionStore, pCertCtx))) { cert = PyBytes_FromStringAndSize((const char*)pCertCtx->pbCertEncoded, pCertCtx->cbCertEncoded); if (!cert) { @@ -6210,7 +6210,7 @@ _ssl_enum_crls_impl(PyObject *module, const char *store_name) return PyErr_SetFromWindowsErr(GetLastError()); } - while (pCrlCtx = CertEnumCRLsInStore(hCollectionStore, pCrlCtx)) { + while ((pCrlCtx = CertEnumCRLsInStore(hCollectionStore, pCrlCtx))) { crl = PyBytes_FromStringAndSize((const char*)pCrlCtx->pbCrlEncoded, pCrlCtx->cbCrlEncoded); if (!crl) { diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index f3ce1fb63222..b7300def8dc7 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -5372,7 +5372,7 @@ _testFileExistsByName(LPCWSTR path, BOOL followLinks) sizeof(info))) { if (!(info.FileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) || - !followLinks && IsReparseTagNameSurrogate(info.ReparseTag)) + (!followLinks && IsReparseTagNameSurrogate(info.ReparseTag))) { return TRUE; } diff --git a/PC/launcher2.c b/PC/launcher2.c index 72121724726c..02ab417bb27e 100644 --- a/PC/launcher2.c +++ b/PC/launcher2.c @@ -2760,7 +2760,7 @@ process(int argc, wchar_t ** argv) // We searched earlier, so if we didn't find anything, now we react exitCode = searchExitCode; // If none found, and if permitted, install it - if (exitCode == RC_NO_PYTHON && isEnvVarSet(L"PYLAUNCHER_ALLOW_INSTALL") || + if (((exitCode == RC_NO_PYTHON) && isEnvVarSet(L"PYLAUNCHER_ALLOW_INSTALL")) || isEnvVarSet(L"PYLAUNCHER_ALWAYS_INSTALL")) { exitCode = installEnvironment(&search); if (!exitCode) { -- 2.47.3