diff options
author | Tavian Barnes <tavianator@gmail.com> | 2011-07-26 09:38:41 -0600 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2011-07-26 09:38:41 -0600 |
commit | 6940ad0441911964573b8c39e816eea6daac897e (patch) | |
tree | 3b63da812b92d69afe1eaac31581071efa33f975 /libdimension-python | |
parent | 5f8ce1e256462a9addbe318966a70a4bc6399bad (diff) | |
download | dimension-6940ad0441911964573b8c39e816eea6daac897e.tar.xz |
Add some sanity checking.
Diffstat (limited to 'libdimension-python')
-rw-r--r-- | libdimension-python/dimension.pyx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libdimension-python/dimension.pyx b/libdimension-python/dimension.pyx index cc8efdb..dd91b0e 100644 --- a/libdimension-python/dimension.pyx +++ b/libdimension-python/dimension.pyx @@ -272,7 +272,7 @@ cdef class Matrix: cpdef Matrix inverse(self): """Return the inverse of a matrix.""" - return _Matrix(dmnsn_matrix_inverse(self._m)); + return _Matrix(dmnsn_matrix_inverse(self._m)) def __repr__(self): return \ @@ -1404,6 +1404,8 @@ cdef class Scene: def __get__(self): return self._scene.nthreads def __set__(self, n): + if n <= 0: + raise ValueError("%d is an invalid thread count." % n) self._scene.nthreads = n property quality: @@ -1464,6 +1466,9 @@ def _string_to_quality(str quality not None): cdef int q = DMNSN_RENDER_NONE inverse = False + if quality == "": + return q + if quality[0] == '^': inverse = True quality = quality[1:] |