"lines", "xpixels" and "ypixels". There is an additional possible
option "update", which if given then all subsequent options ensure
that any possible out of date information is recalculated."""
- args = ['-%s' % arg for arg in args if not arg.startswith('-')]
+ args = ['-%s' % arg for arg in args]
args += [index1, index2]
res = self.tk.call(self._w, 'count', *args) or None
if res is not None and len(args) <= 3:
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