diff options
| author | Floris Bruynooghe <flub@devork.be> | 2020-06-15 22:58:50 +0200 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2020-06-16 08:02:02 -0300 |
| commit | 2d895a0119b423b117d10e890c9e0eb5d2a9cdf8 (patch) | |
| tree | 53cac8051fb2e09b9be94972365ad6d3af956c6b /bindings/python-cffi/notmuch2/_database.py | |
| parent | 131757907907380213b32934d9e73cec942ace43 (diff) | |
Make messages returned by Thread objects owned
This reverses the logic of StandaloneMessage to instead create a
OwnedMessage. Only the Thread class allows retrieving messages more
then once so it can explicitly create such messages.
The added test fails with SIGABRT without the fix for the message
re-use in threads being present.
Diffstat (limited to 'bindings/python-cffi/notmuch2/_database.py')
| -rw-r--r-- | bindings/python-cffi/notmuch2/_database.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bindings/python-cffi/notmuch2/_database.py b/bindings/python-cffi/notmuch2/_database.py index fc55fea8..3c06402d 100644 --- a/bindings/python-cffi/notmuch2/_database.py +++ b/bindings/python-cffi/notmuch2/_database.py @@ -400,7 +400,7 @@ class Database(base.NotmuchObject): capi.lib.NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID] if ret not in ok: raise errors.NotmuchError(ret) - msg = message.StandaloneMessage(self, msg_pp[0], db=self) + msg = message.Message(self, msg_pp[0], db=self) if sync_flags: msg.tags.from_maildir_flags() return self.AddedMessage( @@ -469,7 +469,7 @@ class Database(base.NotmuchObject): msg_p = msg_pp[0] if msg_p == capi.ffi.NULL: raise LookupError - msg = message.StandaloneMessage(self, msg_p, db=self) + msg = message.Message(self, msg_p, db=self) return msg def get(self, filename): @@ -502,7 +502,7 @@ class Database(base.NotmuchObject): msg_p = msg_pp[0] if msg_p == capi.ffi.NULL: raise LookupError - msg = message.StandaloneMessage(self, msg_p, db=self) + msg = message.Message(self, msg_p, db=self) return msg @property |
