change delegation for to_read_description
[deliverable/binutils-gdb.git] / gdb / python / py-event.c
index afd07feca509ebc19a356321fc97e9c742b5f8a6..d2c768f9c9f2014755ae00c130500ca1089080fb 100644 (file)
@@ -1,6 +1,6 @@
 /* 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.
 
@@ -60,11 +60,11 @@ evpy_add_attribute (PyObject *event, char *name, PyObject *attr)
 
 /* 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
@@ -76,17 +76,9 @@ gdbpy_initialize_event_generic (PyTypeObject *type,
                                 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);
 }
 
 
This page took 0.071976 seconds and 4 git commands to generate.