mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-12-19 01:19:41 +08:00
Remove some Python 2 code
I found some Python 2 compatibility code in gdb's Python library. There's no need for this any more, so this removes it. There is still a bit more of this remaining in __init__.py, but I haven't tried removing that yet. Reviewed-By: Bruno Larsen <blarsen@redhat.com>
This commit is contained in:
@@ -30,7 +30,7 @@ class FrameIterator(object):
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
def next(self):
|
||||
def __next__(self):
|
||||
"""next implementation.
|
||||
|
||||
Returns:
|
||||
@@ -41,9 +41,3 @@ class FrameIterator(object):
|
||||
raise StopIteration
|
||||
self.frame = result.older()
|
||||
return result
|
||||
|
||||
# Python 3.x requires __next__(self) while Python 2.x requires
|
||||
# next(self). Define next(self), and for Python 3.x create this
|
||||
# wrapper.
|
||||
def __next__(self):
|
||||
return self.next()
|
||||
|
||||
@@ -190,12 +190,8 @@ def execute_frame_filters(frame, frame_low, frame_high):
|
||||
frame_iterator = FrameIterator(frame)
|
||||
|
||||
# Apply a basic frame decorator to all gdb.Frames. This unifies
|
||||
# the interface. Python 3.x moved the itertools.imap
|
||||
# functionality to map(), so check if it is available.
|
||||
if hasattr(itertools, "imap"):
|
||||
frame_iterator = itertools.imap(FrameDecorator, frame_iterator)
|
||||
else:
|
||||
frame_iterator = map(FrameDecorator, frame_iterator)
|
||||
# the interface.
|
||||
frame_iterator = map(FrameDecorator, frame_iterator)
|
||||
|
||||
for ff in sorted_list:
|
||||
frame_iterator = ff.filter(frame_iterator)
|
||||
|
||||
Reference in New Issue
Block a user