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