Author: mattip <[email protected]>
Branch: cpyext-ext
Changeset: r83682:6e02ba5b13d9
Date: 2016-04-15 10:24 +0300
http://bitbucket.org/pypy/pypy/changeset/6e02ba5b13d9/
Log: avoid segfault in -A tests, still lookiong for why this happens
diff --git a/pypy/objspace/std/typeobject.py b/pypy/objspace/std/typeobject.py
--- a/pypy/objspace/std/typeobject.py
+++ b/pypy/objspace/std/typeobject.py
@@ -630,9 +630,14 @@
if (call_init and not (space.is_w(self, space.w_type) and
not __args__.keywords and len(__args__.arguments_w) == 1)):
w_descr = space.lookup(w_newobject, '__init__')
- w_result = space.get_and_call_args(w_descr, w_newobject, __args__)
- if not space.is_w(w_result, space.w_None):
- raise oefmt(space.w_TypeError, "__init__() should return None")
+ if w_descr:
+ w_result = space.get_and_call_args(w_descr, w_newobject,
__args__)
+ if not space.is_w(w_result, space.w_None):
+ raise oefmt(space.w_TypeError, "__init__() should return
None")
+ else:
+ # XXX FIXME - happens when running
test_tp_new_in_subclass_of_type
+ # but only with pypy pytest.py -A ...
+ print "'__init__' not found when calling %s" %
self.getname(space)
return w_newobject
def descr_repr(self, space):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit