Author: Wim Lavrijsen <[email protected]>
Branch: cppyy-packaging
Changeset: r92083:17bcb20012f1
Date: 2017-08-04 20:52 -0700
http://bitbucket.org/pypy/pypy/changeset/17bcb20012f1/
Log: raise LookupError when failing the dispatch lookup (consistency with
CPyCppyy)
diff --git a/pypy/module/_cppyy/interp_cppyy.py
b/pypy/module/_cppyy/interp_cppyy.py
--- a/pypy/module/_cppyy/interp_cppyy.py
+++ b/pypy/module/_cppyy/interp_cppyy.py
@@ -788,7 +788,7 @@
for f in overload.functions:
if 0 < f.signature().find(sig):
return W_CPPOverload(self.space, self, [f])
- raise oefmt(self.space.w_TypeError, "no overload matches signature")
+ raise oefmt(self.space.w_LookupError, "no overload matches signature")
def missing_attribute_error(self, name):
return oefmt(self.space.w_AttributeError,
diff --git a/pypy/module/_cppyy/test/test_overloads.py
b/pypy/module/_cppyy/test/test_overloads.py
--- a/pypy/module/_cppyy/test/test_overloads.py
+++ b/pypy/module/_cppyy/test/test_overloads.py
@@ -57,7 +57,7 @@
c = c_overload()
raises(TypeError, c.__dispatch__, 'get_int', 12)
- raises(TypeError, c.__dispatch__, 'get_int', 'does_not_exist')
+ raises(LookupError, c.__dispatch__, 'get_int', 'does_not_exist')
assert c.__dispatch__('get_int', 'a_overload*')(a_overload()) == 42
assert c.__dispatch__('get_int', 'b_overload*')(b_overload()) == 13
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit