From 97478b74468d5fdf13f69a31ca942e225eedf9e2 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Thu, 8 Apr 2010 19:40:54 -0700 Subject: [PATCH] Raise error for no suitable constructor. --- Cython/Compiler/PyrexTypes.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Cython/Compiler/PyrexTypes.py b/Cython/Compiler/PyrexTypes.py index b3589219..af9c2612 100755 --- a/Cython/Compiler/PyrexTypes.py +++ b/Cython/Compiler/PyrexTypes.py @@ -2275,8 +2275,11 @@ def best_match(args, functions, pos=None): if len(candidates) == 1: return candidates[0][0] elif len(candidates) == 0: - if len(errors) == 1 and pos is not None: - error(pos, errors[0][1]) + if pos is not None: + if len(errors) == 1: + error(pos, errors[0][1]) + else: + error(pos, "no suitable method found") return None possibilities = [] -- 2.26.2