diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2014-01-29 04:13:45 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2014-01-29 04:13:45 (GMT) |
commit | 1e40295af6be0e43e62a22300cbdfb62e28f237d (patch) | |
tree | e58e29bab6bc78500b01f9b108620b3942c8c624 /Lib/idlelib/SearchEngine.py | |
parent | c369c2c688c407433d88a7cad75cda88fbe799b5 (diff) | |
download | cpython-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.py | 8 |
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 |