Commit 4413b634 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Fix bug: need to init exceptions in addition to new'ing them

parent 4d3d6625
......@@ -861,9 +861,6 @@ public:
static Box* __init__(BoxedEnvironmentError* self, Box* errno_, Box* strerror, Box** _args) {
Box* filename = _args[0];
if (!errno_)
return None;
RELEASE_ASSERT(isSubclass(self->cls, EnvironmentError), "");
self->myerrno = errno_;
......
......@@ -213,10 +213,15 @@ void raise3(Box* arg0, Box* arg1, Box* arg2) {
BoxedClass* c = static_cast<BoxedClass*>(arg0);
if (isSubclass(c, BaseException)) {
Box* exc_obj;
if (arg1 != None)
exc_obj = exceptionNew2(c, arg1);
else
exc_obj = exceptionNew1(c);
if (isSubclass(arg1->cls, BaseException)) {
exc_obj = arg1;
c = exc_obj->cls;
} else if (arg1 != None) {
exc_obj = runtimeCall(c, ArgPassSpec(1), arg1, NULL, NULL, NULL, NULL);
} else {
exc_obj = runtimeCall(c, ArgPassSpec(0), NULL, NULL, NULL, NULL, NULL);
}
raiseRaw(ExcInfo(c, exc_obj, arg2));
}
......
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