[pypy-commit] pypy default: Test and fix: corner case shown by Alex Gaynor.

arigo noreply at buildbot.pypy.org
Sat Aug 11 20:12:29 CEST 2012


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r56705:6d3ff1148dce
Date: 2012-08-11 20:12 +0200
http://bitbucket.org/pypy/pypy/changeset/6d3ff1148dce/

Log:	Test and fix: corner case shown by Alex Gaynor.

diff --git a/pypy/rpython/rbuiltin.py b/pypy/rpython/rbuiltin.py
--- a/pypy/rpython/rbuiltin.py
+++ b/pypy/rpython/rbuiltin.py
@@ -273,10 +273,10 @@
     return i2
 
 def rtype_Exception__init__(hop):
-    pass
+    hop.exception_cannot_occur()
 
 def rtype_object__init__(hop):
-    pass
+    hop.exception_cannot_occur()
 
 def rtype_OSError__init__(hop):
     hop.exception_cannot_occur()
diff --git a/pypy/rpython/test/test_rclass.py b/pypy/rpython/test/test_rclass.py
--- a/pypy/rpython/test/test_rclass.py
+++ b/pypy/rpython/test/test_rclass.py
@@ -958,6 +958,16 @@
                 found.append(op.args[1].value)
         assert found == ['mutate_c']
 
+    def test_calling_object_init(self):
+        class A(object):
+            pass
+        class B(A):
+            def __init__(self):
+                A.__init__(self)
+        def f():
+            B()
+        self.gengraph(f, [])
+
 
 class TestLLtype(BaseTestRclass, LLRtypeMixin):
 


More information about the pypy-commit mailing list