Skip to content

Commit ed7ec3b

Browse files
committed
Revert "Initialize in struct"
This reverts commit 168b699. Apparently some compilers can't handle initialization to a function defined in another module.
1 parent ff4168c commit ed7ec3b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

maxminddb/extension/maxminddb.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,6 @@ static PyTypeObject Reader_Type = {
419419
.tp_methods = Reader_methods,
420420
.tp_name = "Reader",
421421
.tp_init = Reader_constructor,
422-
.tp_new = PyType_GenericNew,
423422
};
424423

425424
static PyMethodDef Metadata_methods[] = {
@@ -507,6 +506,10 @@ MOD_INIT(extension){
507506
RETURN_MOD_INIT(NULL);
508507
}
509508

509+
Reader_Type.tp_new = PyType_GenericNew;
510+
if (PyType_Ready(&Reader_Type)) {
511+
RETURN_MOD_INIT(NULL);
512+
}
510513
Py_INCREF(&Reader_Type);
511514
PyModule_AddObject(m, "Reader", (PyObject *)&Reader_Type);
512515

0 commit comments

Comments
 (0)