diff options
| author | Christoph Reiter <reiter.christoph@gmail.com> | 2018-03-24 17:34:23 +0100 |
|---|---|---|
| committer | Christoph Reiter <reiter.christoph@gmail.com> | 2018-03-24 17:34:23 +0100 |
| commit | bfc759c9c0bb2e90c461315dc852d5faa13f4363 (patch) | |
| tree | e7f303613fb45f7b524bb863713abccd15815537 /gi/pygi-boxed.c | |
| parent | 7607052e0547c6d45f4db9b56246c07194f02ca8 (diff) | |
| download | pygobject-bfc759c9c0bb2e90c461315dc852d5faa13f4363.tar.gz | |
Make sure that types are fully initialized when they are first used.
This asserts that PyType_Ready() was called on the types before using them
to create instances or as base class for other types.
With this PyPy no longer crashes when importing the _gi module.
Diffstat (limited to 'gi/pygi-boxed.c')
| -rw-r--r-- | gi/pygi-boxed.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gi/pygi-boxed.c b/gi/pygi-boxed.c index 6a06eccd..9bc49b1a 100644 --- a/gi/pygi-boxed.c +++ b/gi/pygi-boxed.c @@ -233,6 +233,7 @@ int pygi_boxed_register_types (PyObject *m) { Py_TYPE(&PyGIBoxed_Type) = &PyType_Type; + g_assert (Py_TYPE (&PyGBoxed_Type) != NULL); PyGIBoxed_Type.tp_base = &PyGBoxed_Type; PyGIBoxed_Type.tp_new = (newfunc) _boxed_new; PyGIBoxed_Type.tp_init = (initproc) _boxed_init; |
