Simplify gdbpy_stop_recording
authorTom Tromey <tom@tromey.com>
Thu, 27 Dec 2018 18:57:28 +0000 (11:57 -0700)
committerTom Tromey <tom@tromey.com>
Thu, 3 Jan 2019 21:49:18 +0000 (14:49 -0700)
This simplifies gdbpy_stop_recording, by having it use Py_RETURN_NONE
rather than writing it out manually, and by usin the idiomatic
GDB_PY_HANDLE_EXCEPTION.

gdb/ChangeLog
2019-01-03  Tom Tromey  <tom@tromey.com>

* python/py-record.c (gdbpy_stop_recording): Use Py_RETURN_NONE.

gdb/ChangeLog
gdb/python/py-record.c

index a01c1491ff1eef1a528e3a019bb3b81db9840ce1..6ed1545f5e56c19fab2cf4b5704452e3e9f7ce91 100644 (file)
@@ -1,3 +1,7 @@
+2019-01-03  Tom Tromey  <tom@tromey.com>
+
+       * python/py-record.c (gdbpy_stop_recording): Use Py_RETURN_NONE.
+
 2019-01-03  Tom Tromey  <tom@tromey.com>
 
        * python/py-value.c (valpy_dealloc): Use Py_XDECREF.
index 3d638e5e5df29c22338a8be29b48d9660d48904a..e818560174e9a672213dbde2d444cd1f725a5fd7 100644 (file)
@@ -638,19 +638,15 @@ gdbpy_current_recording (PyObject *self, PyObject *args)
 PyObject *
 gdbpy_stop_recording (PyObject *self, PyObject *args)
 {
-  PyObject *ret = NULL;
-
   TRY
     {
       record_stop (0);
-      ret = Py_None;
-      Py_INCREF (Py_None);
     }
   CATCH (except, RETURN_MASK_ALL)
     {
-      gdbpy_convert_exception (except);
+      GDB_PY_HANDLE_EXCEPTION (except);
     }
   END_CATCH
 
-  return ret;
+  Py_RETURN_NONE;
 }
This page took 0.026983 seconds and 4 git commands to generate.