Do not return string from check_feature()

This commit is contained in:
Andrew Murray 2024-08-12 18:52:38 +10:00
parent cb55ee64b5
commit 24c0569f8d
2 changed files with 6 additions and 1 deletions

View File

@ -128,7 +128,7 @@ features = {
"libjpeg_turbo": ("PIL._imaging", "HAVE_LIBJPEGTURBO", "libjpeg_turbo_version"),
"libimagequant": ("PIL._imaging", "HAVE_LIBIMAGEQUANT", "imagequant_version"),
"xcb": ("PIL._imaging", "HAVE_XCB", None),
"acceleration": ("PIL._imaging", "acceleration", "acceleration"),
"acceleration": ("PIL._imaging", "HAVE_ACCELERATION", "acceleration"),
}

View File

@ -4407,6 +4407,7 @@ setup_module(PyObject *m) {
Py_INCREF(have_xcb);
PyModule_AddObject(m, "HAVE_XCB", have_xcb);
PyObject *have_acceleration = Py_True;
#ifdef __AVX2__
PyModule_AddStringConstant(m, "acceleration", "avx2");
#elif defined(__SSE4__)
@ -4418,7 +4419,11 @@ setup_module(PyObject *m) {
#else
Py_INCREF(Py_False);
PyModule_AddObject(m, "acceleration", Py_False);
have_acceleration = Py_False;
#endif
Py_INCREF(have_acceleration);
PyModule_AddObject(m, "HAVE_ACCELERATION", have_acceleration);
PyObject *pillow_version = PyUnicode_FromString(version);
PyDict_SetItemString(