[Python-checkins] cpython (3.3): Idlelib: forward port changes that silenced 2.7 -3 deprecation warnings and
terry.reedy
python-checkins at python.org
Wed Jan 29 05:14:38 CET 2014
http://hg.python.org/cpython/rev/14782875030c
changeset: 88802:14782875030c
branch: 3.3
parent: 88780:f4377699fd47
user: Terry Jan Reedy <tjreedy at udel.edu>
date: Tue Jan 28 23:13:45 2014 -0500
summary:
Idlelib: forward port changes that silenced 2.7 -3 deprecation warnings and
which are at least as efficient. On Py3, unpacking exceptions never works.
files:
Lib/idlelib/Debugger.py | 3 +--
Lib/idlelib/SearchEngine.py | 8 +++-----
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/Lib/idlelib/Debugger.py b/Lib/idlelib/Debugger.py
--- a/Lib/idlelib/Debugger.py
+++ b/Lib/idlelib/Debugger.py
@@ -254,8 +254,7 @@
self.sync_source_line()
def show_frame(self, stackitem):
- frame, lineno = stackitem
- self.frame = frame
+ self.frame = stackitem[0] # lineno is stackitem[1]
self.show_variables()
localsviewer = None
diff --git a/Lib/idlelib/SearchEngine.py b/Lib/idlelib/SearchEngine.py
--- a/Lib/idlelib/SearchEngine.py
+++ b/Lib/idlelib/SearchEngine.py
@@ -83,11 +83,9 @@
try:
prog = re.compile(pat, flags)
except re.error as what:
- try:
- msg, col = what
- except:
- msg = str(what)
- col = -1
+ args = what.args
+ msg = args[0]
+ col = arg[1] if len(args) >= 2 else -1
self.report_error(pat, msg, col)
return None
return prog
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list