mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-97928: Fix handling options starting with "-" in tkinter.Text.count() (GH-98436)
Previously they were silently ignored. Now they are errors.
(cherry picked from commit e4ec8de6fa
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
a847255cbb
commit
30b9c4d784
3 changed files with 4 additions and 4 deletions
|
@ -76,9 +76,7 @@ class TextTest(AbstractTkTest, unittest.TestCase):
|
|||
self.assertEqual(text.count('1.0', 'end'), (124,) # 'indices' by default
|
||||
if self.wantobjects else ('124',))
|
||||
self.assertRaises(tkinter.TclError, text.count, '1.0', 'end', 'spam')
|
||||
# '-lines' is ignored, 'indices' is used by default
|
||||
self.assertEqual(text.count('1.0', 'end', '-lines'), (124,)
|
||||
if self.wantobjects else ('124',))
|
||||
self.assertRaises(tkinter.TclError, text.count, '1.0', 'end', '-lines')
|
||||
|
||||
self.assertIsInstance(text.count('1.3', '1.5', 'ypixels'), tuple)
|
||||
self.assertIsInstance(text.count('1.3', '1.5', 'update', 'ypixels'), int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue