This is the mail archive of the
archer-commits@sourceware.org
mailing list for the Archer project.
[SCM] archer-tromey-python: * python/python-frame.c (frapy_richcompare): Return
- From: tromey at sourceware dot org
- To: archer-commits at sourceware dot org
- Date: 13 Apr 2009 20:02:46 -0000
- Subject: [SCM] archer-tromey-python: * python/python-frame.c (frapy_richcompare): Return
The branch, archer-tromey-python has been updated
via 4854339f75bdaf4b228fc35579bddbb2a1fecdc1 (commit)
from 1e012c996e121cb35053d239a46bd5dc65b0ce60 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email.
- Log -----------------------------------------------------------------
commit 4854339f75bdaf4b228fc35579bddbb2a1fecdc1
Author: Tom Tromey <tromey@redhat.com>
Date: Mon Apr 13 14:02:24 2009 -0600
* python/python-frame.c (frapy_richcompare): Return
Py_NotImplemented, not an error. Handle Py_NE as well.
* python/lib/gdb/FrameIterator.py (FrameIterator.next): Use 'is'.
-----------------------------------------------------------------------
Summary of changes:
gdb/python/lib/gdb/FrameIterator.py | 4 ++--
gdb/python/python-frame.c | 20 +++++++++++---------
2 files changed, 13 insertions(+), 11 deletions(-)
First 500 lines of diff:
diff --git a/gdb/python/lib/gdb/FrameIterator.py b/gdb/python/lib/gdb/FrameIterator.py
index 87fb074..5654546 100644
--- a/gdb/python/lib/gdb/FrameIterator.py
+++ b/gdb/python/lib/gdb/FrameIterator.py
@@ -1,6 +1,6 @@
# Iterator over frames.
-# Copyright (C) 2008 Free Software Foundation, Inc.
+# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@ class FrameIterator:
def next (self):
result = self.frame
- if result == None:
+ if result is None:
raise StopIteration
self.frame = result.older ()
return result
diff --git a/gdb/python/python-frame.c b/gdb/python/python-frame.c
index 6c33e65..53f29d4 100644
--- a/gdb/python/python-frame.c
+++ b/gdb/python/python-frame.c
@@ -563,21 +563,23 @@ gdbpy_frame_stop_reason_string (PyObject *self, PyObject *args)
static PyObject *
frapy_richcompare (PyObject *self, PyObject *other, int op)
{
- if (!PyObject_TypeCheck (other, &frame_object_type))
- {
- PyErr_SetString (PyExc_TypeError, "Frame object expected in comparison.");
- return NULL;
- }
- else if (op != Py_EQ)
+ int result;
+
+ if (!PyObject_TypeCheck (other, &frame_object_type)
+ || (op != Py_EQ && op != Py_NE))
{
- PyErr_SetString (PyExc_TypeError, "Invalid comparison for gdb.Frame.");
- return NULL;
+ Py_INCREF (Py_NotImplemented);
+ return Py_NotImplemented;
}
if (frame_id_eq (((frame_object *) self)->frame_id,
((frame_object *) other)->frame_id))
- Py_RETURN_TRUE;
+ result = Py_EQ;
+ else
+ result = Py_NE;
+ if (op == result)
+ Py_RETURN_TRUE;
Py_RETURN_FALSE;
}
hooks/post-receive
--
Repository for Project Archer.