mirror of
https://github.com/python/cpython.git
synced 2025-09-03 15:31:08 +00:00
Idlelib: forward port changes that silenced 2.7 -3 deprecation warnings and
which are at least as efficient. On Py3, unpacking exceptions never works.
This commit is contained in:
parent
c369c2c688
commit
1e40295af6
2 changed files with 4 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue