From 547d798d4f9ae977f6cf0e5c1b8ac05f2107a76e Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Wed, 18 Mar 2009 20:48:13 +0000 Subject: [PATCH] Fix for Python 2.6: "with" is now a keyword Reported on ROX web-site. git-svn-id: https://rox.svn.sourceforge.net/svnroot/rox/trunk/Edit@5307 66de3db3-b00d-0410-b41b-f4738ad19bea --- search.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/search.py b/search.py index 590d402..d12d4a4 100644 --- a/search.py +++ b/search.py @@ -260,7 +260,7 @@ class Replace(rox.Dialog): if not replace: rox.alert(_('You need to specify something to search for...')) return - with = self.with_entry.get_text() + replacement = self.with_entry.get_text() changes = [0] if regex: @@ -273,8 +273,8 @@ class Replace(rox.Dialog): python = self.python_with.get_active() if python: try: - code = compile(with, 'With', 'eval') - def with(match): + code = compile(replacement, 'With', 'eval') + def replacement(match): locals = {'old': match.group(0)} try: locals['x'] = float(locals['old']) @@ -285,13 +285,13 @@ class Replace(rox.Dialog): rox.report_exception() return def do_line(line): - new, n = prog.subn(with, line) + new, n = prog.subn(replacement, line) if n: changes[0] += 1 return new else: def do_line(line): - new = line.replace(replace, with) + new = line.replace(replace, replacement) if new == line: return None changes[0] += 1 -- 2.11.4.GIT