mirror of
https://git.notmuchmail.org/git/notmuch
synced 2025-03-14 03:25:15 +01:00
python: have docs reflect current return value behavior
Database.find_message() used to be able to reliably indicate whether a message exists or not (in which case it returns None). However, the recent API change of the notmuch library means we will return None even for all Xapian exceptions, which happens e.g. when the current Database has been modified by another project. Therefore the return value of None cannot be reliably be used to indicate whether a message exists or not. Make the docs state that explicitely. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
parent
417274d698
commit
c50524efd5
1 changed files with 8 additions and 2 deletions
|
@ -358,8 +358,14 @@ class Database(object):
|
|||
|
||||
:param msgid: The message ID
|
||||
:type msgid: string
|
||||
:returns: :class:`Message` or `None` if no message is found or if an
|
||||
out-of-memory situation occurs.
|
||||
:returns: :class:`Message` or `None` if no message is found or
|
||||
if any xapian exception or out-of-memory situation
|
||||
occurs. Do note that Xapian Exceptions include
|
||||
"Database modified" situations, e.g. when the
|
||||
notmuch database has been modified by
|
||||
another program in the meantime. A return value of
|
||||
`None` is therefore no guarantee that the message
|
||||
does not exist.
|
||||
:exception: :exc:`NotmuchError` with STATUS.NOT_INITIALIZED if
|
||||
the database was not intitialized.
|
||||
"""
|
||||
|
|
Loading…
Add table
Reference in a new issue