mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
Fix Issue 1045.
Factor-out common calling code by simplifying the length_hint API. Speed-up the function by caching the PyObject_String for the attribute lookup.
This commit is contained in:
parent
923ad7a948
commit
4e2f714031
5 changed files with 48 additions and 86 deletions
|
@ -523,7 +523,5 @@ class CommonTest(seq_tests.CommonTest):
|
|||
# Bug #1242657
|
||||
class F(object):
|
||||
def __iter__(self):
|
||||
yield 23
|
||||
def __len__(self):
|
||||
raise KeyboardInterrupt
|
||||
self.assertRaises(KeyboardInterrupt, list, F())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue