aboutsummaryrefslogtreecommitdiffstats
path: root/lang/python/pyme/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'lang/python/pyme/core.py')
-rw-r--r--lang/python/pyme/core.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lang/python/pyme/core.py b/lang/python/pyme/core.py
index dafbd9b3..1d6e3847 100644
--- a/lang/python/pyme/core.py
+++ b/lang/python/pyme/core.py
@@ -394,7 +394,10 @@ class Data(GpgmeWrapper):
"""Write buffer given as string or bytes.
If a string is given, it is implicitly encoded using UTF-8."""
- return pygpgme.gpgme_data_write(self.wrapped, buffer)
+ written = pygpgme.gpgme_data_write(self.wrapped, buffer)
+ if written < 0:
+ raise GPGMEError.fromSyserror()
+ return written
def read(self, size = -1):
"""Read at most size bytes, returned as bytes.