summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/python/p_texture.i
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/python/p_texture.i')
-rw-r--r--src/gallium/state_trackers/python/p_texture.i15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gallium/state_trackers/python/p_texture.i b/src/gallium/state_trackers/python/p_texture.i
index 63c63db9eb..b03054adcc 100644
--- a/src/gallium/state_trackers/python/p_texture.i
+++ b/src/gallium/state_trackers/python/p_texture.i
@@ -347,16 +347,15 @@
assert(p_atomic_read(&$self->reference.count) > 0);
- if(offset > $self->size) {
- PyErr_SetString(PyExc_ValueError, "offset must be smaller than buffer size");
- return;
- }
+ if(offset > $self->size)
+ SWIG_exception(SWIG_ValueError, "offset must be smaller than buffer size");
- if(offset + LENGTH > $self->size) {
- PyErr_SetString(PyExc_ValueError, "data length must fit inside the buffer");
- return;
- }
+ if(offset + LENGTH > $self->size)
+ SWIG_exception(SWIG_ValueError, "data length must fit inside the buffer");
pipe_buffer_write(screen, $self, offset, LENGTH, STRING);
+
+fail:
+ return;
}
};