Commit 1f3346fd authored by Kevin Modzelewski's avatar Kevin Modzelewski

Fix cpython_oldstyle_getattr_crash.py

It was just an error-message difference.
parent 7e3c7350
......@@ -472,10 +472,18 @@ static Box* _instanceGetattribute(Box* _inst, BoxedString* attr_str, bool raise_
return incref(inst->inst_cls);
}
Box* attr = instanceGetattributeWithFallback<rewritable>(inst, attr_str, rewrite_args);
if (attr) {
return attr;
} else if (!raise_on_missing) {
try {
Box* attr = instanceGetattributeWithFallback<rewritable>(inst, attr_str, rewrite_args);
if (attr)
return attr;
} catch (ExcInfo e) {
if (!raise_on_missing && e.matches(AttributeError)) {
e.clear();
return NULL;
}
throw e;
}
if (!raise_on_missing) {
return NULL;
} else {
raiseExcHelper(AttributeError, "%s instance has no attribute '%s'", inst->inst_cls->name->data(),
......
# expected: reffail
# This segfaults under python-dbg
# (In a release build it "works" since the use-after-free happens without penalty.)
......@@ -7,7 +6,7 @@ class C:
del self
print "C.__getattr__", attr
del D.__get__
raise AttributeError()
raise AttributeError("our attribute error")
class D(object):
__get__ = C()
......
# expected: reffail
# Generators participate in the notional Python stack just like normal function calls do,
# even if we implement them using separate C stacks.
#
......
# expected: reffail
def f1():
class C(object):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment