This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 3/7] py-symbol: use Py_RETURN_NONE instead of open coding it


From: Jeff Mahoney <jeffm@suse.com>

---
 gdb/python/py-symbol.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c
index c1511b5..cbbc9e2 100644
--- a/gdb/python/py-symbol.c
+++ b/gdb/python/py-symbol.c
@@ -73,8 +73,7 @@ sympy_get_type (PyObject *self, void *closure)
 
   if (SYMBOL_TYPE (symbol) == NULL)
     {
-      Py_INCREF (Py_None);
-      return Py_None;
+      Py_RETURN_NONE;
     }
 
   return type_to_type_object (SYMBOL_TYPE (symbol));
@@ -471,8 +470,7 @@ gdbpy_lookup_global_symbol (PyObject *self, PyObject *args, PyObject *kw)
     }
   else
     {
-      sym_obj = Py_None;
-      Py_INCREF (Py_None);
+      Py_RETURN_NONE;
     }
 
   return sym_obj;
-- 
2.1.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]