mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
Um, I thought I'd already checked this in.
Anyway, this is the changes to the with-statement so that __exit__ must return a true value in order for a pending exception to be ignored. The PEP (343) is already updated.
This commit is contained in:
parent
692cdbc5d6
commit
f669436189
11 changed files with 61 additions and 106 deletions
|
@ -858,8 +858,6 @@ class CodeGenerator:
|
|||
self.nextBlock(final)
|
||||
self.setups.push((END_FINALLY, final))
|
||||
self.emit('WITH_CLEANUP')
|
||||
self.emit('CALL_FUNCTION', 3)
|
||||
self.emit('POP_TOP')
|
||||
self.emit('END_FINALLY')
|
||||
self.setups.pop()
|
||||
self.__with_count -= 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue