Idlelib: silence two buildbot Deprecation Warnings with better code.

This commit is contained in:
Terry Jan Reedy 2014-01-28 23:13:35 -05:00
parent 9ca520a09c
commit 8119c13fe4
2 changed files with 6 additions and 8 deletions

View File

@ -253,8 +253,8 @@ class Debugger:
if self.vsource.get(): if self.vsource.get():
self.sync_source_line() self.sync_source_line()
def show_frame(self, (frame, lineno)): def show_frame(self, stackitem):
self.frame = frame self.frame = stackitem[0] # lineno is stackitem[1]
self.show_variables() self.show_variables()
localsviewer = None localsviewer = None

View File

@ -83,11 +83,9 @@ class SearchEngine:
try: try:
prog = re.compile(pat, flags) prog = re.compile(pat, flags)
except re.error as what: except re.error as what:
try: args = what.args
msg, col = what msg = args[0]
except: col = arg[1] if len(args) >= 2 else -1
msg = str(what)
col = -1
self.report_error(pat, msg, col) self.report_error(pat, msg, col)
return None return None
return prog return prog
@ -231,6 +229,6 @@ def get_line_col(index):
return line, col return line, col
if __name__ == "__main__": if __name__ == "__main__":
from test import support; support.use_resources = ['gui'] from test import test_support; test_support.use_resources = ['gui']
import unittest import unittest
unittest.main('idlelib.idle_test.test_searchengine', verbosity=2, exit=False) unittest.main('idlelib.idle_test.test_searchengine', verbosity=2, exit=False)