mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Move exc state to generator. Fixes bpo-25612 (#1773)
Move exception state information from frame objects to coroutine (generator/thread) object where it belongs.
This commit is contained in:
parent
91dc64ba3f
commit
ae3087c638
13 changed files with 188 additions and 164 deletions
|
@ -971,7 +971,7 @@ class SizeofTest(unittest.TestCase):
|
|||
nfrees = len(x.f_code.co_freevars)
|
||||
extras = x.f_code.co_stacksize + x.f_code.co_nlocals +\
|
||||
ncells + nfrees - 1
|
||||
check(x, vsize('8P2c4P3ic' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P'))
|
||||
check(x, vsize('5P2c4P3ic' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P'))
|
||||
# function
|
||||
def func(): pass
|
||||
check(func, size('12P'))
|
||||
|
@ -988,7 +988,7 @@ class SizeofTest(unittest.TestCase):
|
|||
check(bar, size('PP'))
|
||||
# generator
|
||||
def get_gen(): yield 1
|
||||
check(get_gen(), size('Pb2PPP'))
|
||||
check(get_gen(), size('Pb2PPP4P'))
|
||||
# iterator
|
||||
check(iter('abc'), size('lP'))
|
||||
# callable-iterator
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue