summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/SearchEngine.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2014-01-29 04:13:45 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2014-01-29 04:13:45 (GMT)
commit1e40295af6be0e43e62a22300cbdfb62e28f237d (patch)
treee58e29bab6bc78500b01f9b108620b3942c8c624 /Lib/idlelib/SearchEngine.py
parentc369c2c688c407433d88a7cad75cda88fbe799b5 (diff)
downloadcpython-1e40295af6be0e43e62a22300cbdfb62e28f237d.zip
cpython-1e40295af6be0e43e62a22300cbdfb62e28f237d.tar.gz
cpython-1e40295af6be0e43e62a22300cbdfb62e28f237d.tar.bz2
Idlelib: forward port changes that silenced 2.7 -3 deprecation warnings and
which are at least as efficient. On Py3, unpacking exceptions never works.
Diffstat (limited to 'Lib/idlelib/SearchEngine.py')
-rw-r--r--Lib/idlelib/SearchEngine.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/idlelib/SearchEngine.py b/Lib/idlelib/SearchEngine.py
index bbd221d..9d3c4cb 100644
--- a/Lib/idlelib/SearchEngine.py
+++ b/Lib/idlelib/SearchEngine.py
@@ -83,11 +83,9 @@ class SearchEngine:
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