aboutsummaryrefslogtreecommitdiffhomepage
path: root/bindings
diff options
context:
space:
mode:
authorGravatar Justus Winter <4winter@informatik.uni-hamburg.de>2012-05-17 18:14:58 +0200
committerGravatar Justus Winter <4winter@informatik.uni-hamburg.de>2012-05-17 18:23:11 +0200
commit8f667be2aca7d903a82344490045dff4110f68d7 (patch)
tree5f01c0b538b232e4bfcd94c1f80dab2872d2f1f1 /bindings
parent8e3faa7f18d9ca87a77834d76f4b8db95669252b (diff)
python: fix Message.get_header
8dc8495010057202b725ac029831c03f4e3ab6bd introduced a bug, if the requested header is not set the underlying notmuch function returns an empty string that also made the expression true resulting in an exception being raised. Partly revert the commit to fix this issue. Testing for equality with None is correct in this case since the restype of the function Message._get_header is c_char_p so NULL pointers are in fact converted to None in this case. Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
Diffstat (limited to 'bindings')
-rw-r--r--bindings/python/notmuch/message.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bindings/python/notmuch/message.py b/bindings/python/notmuch/message.py
index d7f029f8..d1c1b58c 100644
--- a/bindings/python/notmuch/message.py
+++ b/bindings/python/notmuch/message.py
@@ -229,7 +229,7 @@ class Message(Python3StringMixIn):
#Returns NULL if any error occurs.
header = Message._get_header(self._msg, _str(header))
- if not header:
+ if header == None:
raise NullPointerError()
return header.decode('UTF-8', 'ignore')