summaryrefslogtreecommitdiffstats
path: root/libdimension-python/dimension.pyx
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-09-18 17:02:26 -0400
committerTavian Barnes <tavianator@gmail.com>2011-09-18 17:02:26 -0400
commitd6aa225ca7990fde1eac09e28078e71b73d113ce (patch)
tree0e23549ee8ed93edd8f8bc9ff8c90af93fe21faa /libdimension-python/dimension.pyx
parent126c9b7b4b2c5f43b7d86f821bf5b7a416836a7e (diff)
downloaddimension-d6aa225ca7990fde1eac09e28078e71b73d113ce.tar.xz
Fix --disable-png behaviour in the Python module.
Diffstat (limited to 'libdimension-python/dimension.pyx')
-rw-r--r--libdimension-python/dimension.pyx16
1 files changed, 13 insertions, 3 deletions
diff --git a/libdimension-python/dimension.pyx b/libdimension-python/dimension.pyx
index b8855fe..dffa8fa 100644
--- a/libdimension-python/dimension.pyx
+++ b/libdimension-python/dimension.pyx
@@ -569,9 +569,19 @@ cdef class Canvas:
if fclose(file) != 0:
_raise_OSError()
- progress = _Progress(dmnsn_png_write_canvas_async(self._canvas, file))
- progress._finalizer = finalize
- return progress
+ cdef dmnsn_progress *progress = dmnsn_png_write_canvas_async(self._canvas,
+ file)
+
+ try:
+ if progress == NULL:
+ _raise_OSError()
+
+ ret = _Progress(progress)
+ ret._finalizer = finalize
+ return ret
+ except:
+ finalize()
+ raise
def draw_GL(self):
"""Export the canvas to the current OpenGL context."""