mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
9bc711bd04
commit
e6f0c0f6e3
@ -52,8 +52,8 @@ class Database:
|
||||
return self.conn.__enter__()
|
||||
|
||||
def __exit__(self, exc_type, exc_value, tb) -> bool | None:
|
||||
with closing(self.conn):
|
||||
suppress_exception = self.conn.__exit__(exc_type, exc_value, tb)
|
||||
self.conn.close()
|
||||
if self.needs_copy and (suppress_exception or (exc_type is None and exc_value is None and tb is None)):
|
||||
self.copy_db()
|
||||
return suppress_exception
|
||||
|
Loading…
x
Reference in New Issue
Block a user