summaryrefslogtreecommitdiff
path: root/py/runtime.c
diff options
context:
space:
mode:
authorDrew Fustini <drew@pdp7.com>2020-02-10 00:11:35 +0100
committerGitHub <noreply@github.com>2020-02-10 00:11:35 +0100
commit7bdc8b36a697cff816e6e449706bb060f66b3229 (patch)
tree5e7ef62c0a1635febaf90734638d161d9f9228bd /py/runtime.c
parent3aed0a1fd721550bedd8f2258707f58eb9927404 (diff)
parentb93d6e861b80d34ff3b09f4f84a85a6bfd531f3d (diff)
Merge pull request #1 from adafruit/master
update to adafruit master
Diffstat (limited to 'py/runtime.c')
-rw-r--r--py/runtime.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/py/runtime.c b/py/runtime.c
index 48416bab2..c1c311ae4 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -29,10 +29,12 @@
#include <string.h>
#include <assert.h>
+
#include "extmod/vfs.h"
#include "py/parsenum.h"
#include "py/compile.h"
+#include "py/mperrno.h"
#include "py/objstr.h"
#include "py/objtuple.h"
#include "py/objtype.h"
@@ -1576,6 +1578,14 @@ NORETURN void mp_raise_OSError_msg(const compressed_string_t *msg) {
mp_raise_msg(&mp_type_OSError, msg);
}
+NORETURN void mp_raise_OSError_errno_str(int errno_, mp_obj_t str) {
+ mp_obj_t args[2] = {
+ MP_OBJ_NEW_SMALL_INT(errno_),
+ str,
+ };
+ nlr_raise(mp_obj_new_exception_args(&mp_type_OSError, 2, args));
+}
+
NORETURN void mp_raise_OSError_msg_varg(const compressed_string_t *fmt, ...) {
va_list argptr;
va_start(argptr,fmt);