mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
...
This commit is contained in:
parent
e958df9028
commit
b2eac6f919
@ -296,7 +296,9 @@ class Blocks(object):
|
||||
self.pos = len(self.all_blocks)
|
||||
self.block_map = {}
|
||||
|
||||
def __exit__(self, *args):
|
||||
def __exit__(self, etype, value, traceback):
|
||||
if value is not None:
|
||||
return # Since there was an exception, the data structures are not in a consistent state
|
||||
if self.current_block is not None:
|
||||
self.all_blocks.append(self.current_block)
|
||||
self.current_block = None
|
||||
|
Loading…
x
Reference in New Issue
Block a user