Author: mattip <matti.pi...@gmail.com> Branch: object-dtype2 Changeset: r76837:df509dc69d3e Date: 2015-04-19 23:25 +0300 http://bitbucket.org/pypy/pypy/changeset/df509dc69d3e/
Log: prefer obscure exception to a segfault diff --git a/pypy/module/micronumpy/types.py b/pypy/module/micronumpy/types.py --- a/pypy/module/micronumpy/types.py +++ b/pypy/module/micronumpy/types.py @@ -1686,9 +1686,12 @@ self._write(storage, i, offset, value, gcstruct) def unbox(self, box): - assert isinstance(box, self.BoxType) - return box.w_obj - + if isinstance(box, self.BoxType): + return box.w_obj + else: + raise oefmt(self.space.w_NotImplementedError, + "object dtype cannot unbox %s", str(box)) + @specialize.argtype(1) def box(self, w_obj): if isinstance(w_obj, W_Root): _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit