Commit e7cbd3f0 authored by Terry Jan Reedy's avatar Terry Jan Reedy

Issue #18365: 2.7 corrections so tests run

parent d781b07e
...@@ -114,7 +114,7 @@ class Text(object): ...@@ -114,7 +114,7 @@ class Text(object):
try: try:
index=index.lower() index=index.lower()
except AttributeError: except AttributeError:
raise TclError('bad text index "%s"' % index) from None raise TclError('bad text index "%s"' % index)
lastline = len(self.data) - 1 # same as number of text lines lastline = len(self.data) - 1 # same as number of text lines
if index == 'insert': if index == 'insert':
......
# Test mock_tk.Text class against tkinter.Text class by running same tests with both. # Test mock_tk.Text class against tkinter.Text class by running same tests with both.
import unittest import unittest
from test.support import requires from test.test_support import requires
from _tkinter import TclError from _tkinter import TclError
import tkinter as tk import Tkinter as tk
class TextTest(object): class TextTest(object):
...@@ -214,7 +214,7 @@ class TkTextTest(TextTest, unittest.TestCase): ...@@ -214,7 +214,7 @@ class TkTextTest(TextTest, unittest.TestCase):
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
requires('gui') requires('gui')
from tkinter import Tk, Text from Tkinter import Tk, Text
cls.Text = Text cls.Text = Text
cls.root = Tk() cls.root = Tk()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment