Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix propagation of AttrError in evaluable.asarray
`evaluable.asarray(arg)` converts its `arg` to an `evaluable.Array` by first trying `arg.as_evaluable_array` and if this is absent calling `numpy.array(arg)` (via `Constant`). The attribute `arg.as_evaluable_array` is assumed to be absent if it raises an `AttributeError`. However, if the attribute is a property that somewhere down the road raises `AttributeError`, this should be considered an error and the exception should be propagated. This patch fixes this problem by testing the existence of `as_evaluable_array` on the class using `hasattr`.
- Loading branch information