[pypy-commit] pypy cpyext-fast-typecheck: test and fix typo

antocuni pypy.commits at gmail.com
Thu Mar 22 11:39:19 EDT 2018


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: cpyext-fast-typecheck
Changeset: r94079:624c476bc7cd
Date: 2018-03-22 14:12 +0000
http://bitbucket.org/pypy/pypy/changeset/624c476bc7cd/

Log:	test and fix typo

diff --git a/pypy/module/cpyext/methodobject.py b/pypy/module/cpyext/methodobject.py
--- a/pypy/module/cpyext/methodobject.py
+++ b/pypy/module/cpyext/methodobject.py
@@ -252,7 +252,7 @@
         # XXX: check for keywords
         length = len(__args__.arguments_w)
         if length != arity:
-            raise oefmt(space.w_TypeError, "expected %d arguments, got %d",
+            raise oefmt(self.space.w_TypeError, "expected %d arguments, got %d",
                         arity, length)
 
     def descr_method_repr(self):
diff --git a/pypy/module/cpyext/test/test_typeobject.py b/pypy/module/cpyext/test/test_typeobject.py
--- a/pypy/module/cpyext/test/test_typeobject.py
+++ b/pypy/module/cpyext/test/test_typeobject.py
@@ -823,6 +823,7 @@
             ''')
         obj = module.new_obj()
         assert obj[100] == 42
+        raises(TypeError, "obj.__getitem__(100, 101)")
 
     def test_mp_ass_subscript(self):
         module = self.import_extension('foo', [


More information about the pypy-commit mailing list