From 06e7180e6532d03a4c92cf01092593c829272799 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 19 May 2026 15:14:09 +0200 Subject: [PATCH] gh-149879: Fix test_c_stack_unwind on Cygwin On Cygwin, the Python library is called "cygpython3.16.dll". --- Modules/_testinternalcapi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Modules/_testinternalcapi.c b/Modules/_testinternalcapi.c index b8a22c439e853d..088f0e46c6c658 100644 --- a/Modules/_testinternalcapi.c +++ b/Modules/_testinternalcapi.c @@ -240,10 +240,17 @@ classify_address(uintptr_t addr, int jit_enabled, PyInterpreterState *interp) if (strncmp(base, "python", 6) == 0) { return "python"; } +#ifdef __CYGWIN__ + // Match Cygwin "cygpython3.16.dll" + if (strncmp(base, "cygpython", 9) == 0) { + return "python"; + } +#else // Match "libpython3.15.so.1.0" if (strncmp(base, "libpython", 9) == 0) { return "python"; } +#endif return "other"; } #ifdef _Py_JIT