From 95e79937c21d61f1e384512f1a8c1915e0da1ee1 Mon Sep 17 00:00:00 2001 From: Michael Schindler Date: Tue, 27 Sep 2005 08:37:53 +0000 Subject: [PATCH] allow empty return value for realpolyroots git-svn-id: https://pyx.svn.sourceforge.net/svnroot/pyx/trunk/pyx@2490 069f4177-920e-0410-937b-c2a4a81bcd90 --- pyx/helper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyx/helper.py b/pyx/helper.py index 7a62b19c..d500aa01 100644 --- a/pyx/helper.py +++ b/pyx/helper.py @@ -41,9 +41,12 @@ def realpolyroots(coeffs, epsilon=1e-5, polish=0): The solution is found via an equivalent eigenvalue problem """ + if not coeffs: + return [] + try: 1.0 / coeffs[-1] - except: + except ZeroDivisionError: roots = realpolyroots(coeffs[:-1], epsilon=epsilon) else: # divide the coefficients by the maximal order -- 2.11.4.GIT