Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d0510fd

Browse files
committed
ci: Enable PyPy wheels on Windows.
PyPy does not correctly define `PyErr_SetFromWindowsErr`: https://foss.heptapod.net/pypy/pypy/-/issues/3533
1 parent af1c95f commit d0510fd

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.github/workflows/cibuildwheel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
CIBW_BUILD: "pp37-*"
9494
CIBW_BEFORE_BUILD: pip install certifi numpy==${{ env.min-numpy-version }}
9595
CIBW_ARCHS: ${{ matrix.cibw_archs }}
96-
if: runner.os != 'Windows' && matrix.cibw_archs != 'aarch64'
96+
if: matrix.cibw_archs != 'aarch64'
9797

9898
- name: Validate that LICENSE files are included in wheels
9999
run: |

src/_c_internal_utils.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,13 @@ mpl_GetCurrentProcessExplicitAppUserModelID(PyObject* module)
6868
wchar_t* appid = NULL;
6969
HRESULT hr = GetCurrentProcessExplicitAppUserModelID(&appid);
7070
if (FAILED(hr)) {
71+
#if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x07030600
72+
/* Remove when we require PyPy 7.3.6 */
73+
PyErr_SetFromWindowsErr(hr);
74+
return NULL;
75+
#else
7176
return PyErr_SetFromWindowsErr(hr);
77+
#endif
7278
}
7379
PyObject* py_appid = PyUnicode_FromWideChar(appid, -1);
7480
CoTaskMemFree(appid);
@@ -89,7 +95,13 @@ mpl_SetCurrentProcessExplicitAppUserModelID(PyObject* module, PyObject* arg)
8995
HRESULT hr = SetCurrentProcessExplicitAppUserModelID(appid);
9096
PyMem_Free(appid);
9197
if (FAILED(hr)) {
98+
#if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x07030600
99+
/* Remove when we require PyPy 7.3.6 */
100+
PyErr_SetFromWindowsErr(hr);
101+
return NULL;
102+
#else
92103
return PyErr_SetFromWindowsErr(hr);
104+
#endif
93105
}
94106
Py_RETURN_NONE;
95107
#else

0 commit comments

Comments
 (0)