Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: jeffm@suse.com
To: gdb-patches@sourceware.org
Cc: Jeff Mahoney <jeffm@suse.com>
Subject: [PATCH 3/7] py-symbol: use Py_RETURN_NONE instead of open coding it
Date: Thu, 04 Feb 2016 17:29:00 -0000	[thread overview]
Message-ID: <1454606973-31017-4-git-send-email-jeffm@suse.com> (raw)
In-Reply-To: <1454606973-31017-1-git-send-email-jeffm@suse.com>

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


  parent reply	other threads:[~2016-02-04 17:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-04 17:29 [PATCH 0/7] Python extension patchset jeffm
2016-02-04 17:29 ` [PATCH 1/7] check_types_equal: short circuit check if identical pointers are used jeffm
2016-02-04 17:29 ` [PATCH 4/7] py-symbol: Require a frame for lookup_symbol only when necessary jeffm
2016-02-05 12:17   ` Phil Muldoon
2016-02-05 16:08     ` Jeff Mahoney
2016-02-05 16:35   ` Phil Muldoon
2016-02-04 17:29 ` [PATCH 7/7] py-regcache: Add interface to regcache jeffm
2016-02-04 17:29 ` [PATCH 6/7] py-minsymbol: Add interface to access minimal_symbols jeffm
2016-02-05 12:25   ` Phil Muldoon
2016-02-05 16:43   ` Phil Muldoon
2016-02-08 15:51     ` Jeff Mahoney
2016-02-04 17:29 ` jeffm [this message]
2016-02-04 17:43 ` [PATCH 5/7] py-symbol: export section name jeffm
2016-02-05 12:18   ` Phil Muldoon
2016-02-04 17:43 ` [PATCH 2/7] py-value: properly handle unsigned and pointer types jeffm
2016-02-05 12:12   ` Phil Muldoon
2016-02-05 12:29     ` Phil Muldoon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1454606973-31017-4-git-send-email-jeffm@suse.com \
    --to=jeffm@suse.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox