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

Fix this error (not sure why it wasn't getting exposed before)

And now things work!
parent f1e8700d
......@@ -26,6 +26,7 @@
#include "core/ast.h"
#include "core/types.h"
#include "gc/collector.h"
#include "runtime/capi.h"
#include "runtime/classobj.h"
#include "runtime/ics.h"
#include "runtime/import.h"
......@@ -262,8 +263,11 @@ Box* open(Box* arg1, Box* arg2) {
const std::string& mode = static_cast<BoxedString*>(arg2)->s;
FILE* f = fopen(fn.c_str(), mode.c_str());
if (!f)
raiseExcHelper(IOError, "[Errno %d] %s: '%s'", errno, strerror(errno), fn.c_str());
if (!f) {
PyErr_SetFromErrnoWithFilename(IOError, fn.c_str());
checkAndThrowCAPIException();
abort(); // unreachable;
}
return new BoxedFile(f, fn, mode);
}
......
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