We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb27281 commit 7ee71f6Copy full SHA for 7ee71f6
jupyter_server_fileid/manager.py
@@ -386,8 +386,14 @@ def __del__(self):
386
"""Cleans up `ArbitraryFileIdManager` by committing any pending
387
transactions and closing the connection."""
388
if hasattr(self, "con"):
389
- self.con.commit()
390
- self.con.close()
+ # If garbage collection happens in a different thread than the thread where
+ # the SQLite object was created, committing will fail anyway. We just ignore
391
+ # the exception if this is the case.
392
+ try:
393
+ self.con.commit()
394
+ self.con.close()
395
+ except sqlite3.ProgrammingError:
396
+ pass
397
398
399
class LocalFileIdManager(BaseFileIdManager):
0 commit comments