Raise error for no suitable constructor.
authorRobert Bradshaw <robertwb@math.washington.edu>
Fri, 9 Apr 2010 02:40:54 +0000 (19:40 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Fri, 9 Apr 2010 02:40:54 +0000 (19:40 -0700)
Cython/Compiler/PyrexTypes.py

index b35892194b8b1fc160cbb09f2b92b5fff7fc35b7..af9c26127585f02f0beda3f79f505c39d0dc98d7 100755 (executable)
@@ -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 = []