Commit cfa81fb3 authored by Marius Wachtler's avatar Marius Wachtler

super: don't assert on nonexisting attributes

parent 8d001091
......@@ -127,10 +127,10 @@ Box* superGetattribute(Box* _s, Box* _attr) {
}
}
Box* r = typeLookup(s->cls, attr);
// TODO implement this
RELEASE_ASSERT(r, "should call the equivalent of objectGetattr here");
return processDescriptor(r, s, s->cls);
Box* rtn = PyObject_GenericGetAttr(s, attr);
if (!rtn)
throwCAPIException();
return rtn;
}
Box* super_getattro(Box* _s, Box* _attr) noexcept {
......
......@@ -19,6 +19,11 @@ class C(B):
def f(self):
print "C.f()"
super(C, self).f()
print super(C, self).__thisclass__
try:
super(C, self).does_not_exist
except AttributeError as e:
print e
c = C(1, 2)
print c.arg1
......
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