From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25642 invoked by alias); 4 Feb 2015 16:43:11 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 25621 invoked by uid 9674); 4 Feb 2015 16:43:10 -0000 Date: Wed, 04 Feb 2015 16:43:00 -0000 Message-ID: <20150204164310.25593.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] tromey/python: in_scope.py: Fix Python3 incompatibilities. X-Git-Refname: refs/heads/tromey/python X-Git-Reftype: branch X-Git-Oldrev: 8baa783f3ae8013c1ae623640d90ddb5b5ff90e5 X-Git-Newrev: 89a19af106857845ac47c2e400f71631c36641e5 X-SW-Source: 2015-q1/txt/msg00004.txt.bz2 List-Id: The branch, tromey/python has been updated via 89a19af106857845ac47c2e400f71631c36641e5 (commit) from 8baa783f3ae8013c1ae623640d90ddb5b5ff90e5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 89a19af106857845ac47c2e400f71631c36641e5 Author: Jan Kratochvil Date: Wed Feb 4 17:42:53 2015 +0100 in_scope.py: Fix Python3 incompatibilities. ----------------------------------------------------------------------- Summary of changes: gdb/python/lib/gdb/function/in_scope.py | 32 +++++++++++++++--------------- 1 files changed, 16 insertions(+), 16 deletions(-) First 500 lines of diff: diff --git a/gdb/python/lib/gdb/function/in_scope.py b/gdb/python/lib/gdb/function/in_scope.py index debb3bb..8742680 100644 --- a/gdb/python/lib/gdb/function/in_scope.py +++ b/gdb/python/lib/gdb/function/in_scope.py @@ -22,26 +22,26 @@ class InScope (gdb.Function): Takes one argument for each variable name to be checked.""" def __init__ (self): - super (InScope, self).__init__ ("in_scope") + super (InScope, self).__init__ ("in_scope") def invoke (self, *vars): if len (vars) == 0: - raise TypeError, "in_scope takes at least one argument" + raise (TypeError, "in_scope takes at least one argument") # gdb.Value isn't hashable so it can't be put in a map. - # Convert to string first. - wanted = set (map (lambda x: x.string (), vars)) - found = set () - block = gdb.selected_frame ().block () - while block: - for sym in block: - if (sym.is_argument or sym.is_constant - or sym.is_function or sym.is_variable): - if sym.name in wanted: - found.add (sym.name) - - block = block.superblock - - return wanted == found + # Convert to string first. + wanted = set (map (lambda x: x.string (), vars)) + found = set () + block = gdb.selected_frame ().block () + while block: + for sym in block: + if (sym.is_argument or sym.is_constant + or sym.is_function or sym.is_variable): + if sym.name in wanted: + found.add (sym.name) + + block = block.superblock + + return wanted == found InScope () hooks/post-receive -- Repository for Project Archer.