From d50bf3e52dae076d07cdc139243266c8808654c6 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 22 Oct 2014 14:57:19 +0200 Subject: series_expansion: catch IndexError as well It seems numpy arrays throw this instead of TypeError. --- series_expansion.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/series_expansion.py b/series_expansion.py index 9cd7671..edee84e 100644 --- a/series_expansion.py +++ b/series_expansion.py @@ -19,7 +19,7 @@ class SeriesExpansion(object): if self._dim == 1: try: basis[0] - except TypeError: + except (TypeError, IndexError): basis = [basis] if len(basis) != coeffs.ndim: @@ -41,7 +41,7 @@ class SeriesExpansion(object): if self._dim == 1: try: coords[0][0] - except TypeError: + except (TypeError, IndexError): coords = [coords] if diff_order is None: -- cgit v1.2.3