/* Python interface to inferior events.
- Copyright (C) 2009-2013 Free Software Foundation, Inc.
+ Copyright (C) 2009-2014 Free Software Foundation, Inc.
This file is part of GDB.
/* Initialize the Python event code. */
-void
+int
gdbpy_initialize_event (void)
{
- gdbpy_initialize_event_generic (&event_object_type,
- "Event");
+ return gdbpy_initialize_event_generic (&event_object_type,
+ "Event");
}
/* Initialize the given event type. If BASE is not NULL it will
char *name)
{
if (PyType_Ready (type) < 0)
- goto fail;
-
- Py_INCREF (type);
- if (PyModule_AddObject (gdb_module, name, (PyObject *) type) < 0)
- goto fail;
-
- return 0;
-
- fail:
- Py_XDECREF (type);
return -1;
+
+ return gdb_pymodule_addobject (gdb_module, name, (PyObject *) type);
}