Throw an exception if notmuch_database_close or notmuch_database_destroy
fail.
_destroy = nmlib.notmuch_database_destroy
_destroy.argtypes = [NotmuchDatabaseP]
_destroy = nmlib.notmuch_database_destroy
_destroy.argtypes = [NotmuchDatabaseP]
- _destroy.restype = None
+ _destroy.restype = c_uint
def __del__(self):
if self._db:
def __del__(self):
if self._db:
- self._destroy(self._db)
+ status = self._destroy(self._db)
+ if status != STATUS.SUCCESS:
+ raise NotmuchError(status)
def _assert_db_is_initialized(self):
"""Raises :exc:`NotInitializedError` if self._db is `None`"""
def _assert_db_is_initialized(self):
"""Raises :exc:`NotInitializedError` if self._db is `None`"""
_close = nmlib.notmuch_database_close
_close.argtypes = [NotmuchDatabaseP]
_close = nmlib.notmuch_database_close
_close.argtypes = [NotmuchDatabaseP]
+ _close.restype = c_uint
NotmuchError.
'''
if self._db:
NotmuchError.
'''
if self._db:
+ status = self._close(self._db)
+ if status != STATUS.SUCCESS:
+ raise NotmuchError(status)