Merge pull request #7002 from radarhere/setup_module

This commit is contained in:
Hugo van Kemenade 2023-03-12 13:09:03 +02:00 committed by GitHub
commit 436ebdb191
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -955,6 +955,13 @@ addTransparencyFlagToModule(PyObject *m) {
static int static int
setup_module(PyObject *m) { setup_module(PyObject *m) {
#ifdef HAVE_WEBPANIM
/* Ready object types */
if (PyType_Ready(&WebPAnimDecoder_Type) < 0 ||
PyType_Ready(&WebPAnimEncoder_Type) < 0) {
return -1;
}
#endif
PyObject *d = PyModule_GetDict(m); PyObject *d = PyModule_GetDict(m);
addMuxFlagToModule(m); addMuxFlagToModule(m);
addAnimFlagToModule(m); addAnimFlagToModule(m);
@ -963,13 +970,6 @@ setup_module(PyObject *m) {
PyDict_SetItemString( PyDict_SetItemString(
d, "webpdecoder_version", PyUnicode_FromString(WebPDecoderVersion_str())); d, "webpdecoder_version", PyUnicode_FromString(WebPDecoderVersion_str()));
#ifdef HAVE_WEBPANIM
/* Ready object types */
if (PyType_Ready(&WebPAnimDecoder_Type) < 0 ||
PyType_Ready(&WebPAnimEncoder_Type) < 0) {
return -1;
}
#endif
return 0; return 0;
} }