From: Robert Bradshaw Date: Fri, 9 Apr 2010 02:40:54 +0000 (-0700) Subject: Raise error for no suitable constructor. X-Git-Tag: 0.13.beta0~240 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=97478b74468d5fdf13f69a31ca942e225eedf9e2;p=cython.git Raise error for no suitable constructor. --- 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 = []