Idlelib: silence two buildbot Deprecation Warnings with better code.
diff --git a/Lib/idlelib/SearchEngine.py b/Lib/idlelib/SearchEngine.py
index ea6f1de..9517412 100644
--- 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
@@ -231,6 +229,6 @@
return line, col
if __name__ == "__main__":
- from test import support; support.use_resources = ['gui']
+ from test import test_support; test_support.use_resources = ['gui']
import unittest
unittest.main('idlelib.idle_test.test_searchengine', verbosity=2, exit=False)