summaryrefslogtreecommitdiffstatshomepage
path: root/py/stream.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-01-08 18:11:23 +0000
committerDamien George <damien.p.george@gmail.com>2014-01-08 18:11:23 +0000
commit6c73ca1e754aa5fb822999a0b46f01e216619ec6 (patch)
tree6fdd7b4205d2a4ef7056753ff067f78fb1197f41 /py/stream.c
parent199b9e04eb186320f5d94bdc3b852f2443e466e0 (diff)
downloadmicropython-6c73ca1e754aa5fb822999a0b46f01e216619ec6.tar.gz
micropython-6c73ca1e754aa5fb822999a0b46f01e216619ec6.zip
py: add variable argument exception constructor function.
Addresses issue #104.
Diffstat (limited to 'py/stream.c')
-rw-r--r--py/stream.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/stream.c b/py/stream.c
index 82a5aac10b..f883efcd25 100644
--- a/py/stream.c
+++ b/py/stream.c
@@ -23,7 +23,7 @@ static mp_obj_t stream_read(mp_obj_t self_in, mp_obj_t arg) {
int error;
machine_int_t out_sz = o->type->stream_p.read(self_in, buf, sz, &error);
if (out_sz == -1) {
- nlr_jump(mp_obj_new_exception_msg_1_arg(MP_QSTR_OSError, "[Errno %d]", (const char *)error));
+ nlr_jump(mp_obj_new_exception_msg_varg(MP_QSTR_OSError, "[Errno %d]", error));
} else {
buf[out_sz] = 0;
return mp_obj_new_str(qstr_from_str_take(buf, /*out_sz,*/ sz + 1));
@@ -42,7 +42,7 @@ static mp_obj_t stream_write(mp_obj_t self_in, mp_obj_t arg) {
int error;
machine_int_t out_sz = o->type->stream_p.write(self_in, buf, sz, &error);
if (out_sz == -1) {
- nlr_jump(mp_obj_new_exception_msg_1_arg(MP_QSTR_OSError, "[Errno %d]", (const char *)error));
+ nlr_jump(mp_obj_new_exception_msg_varg(MP_QSTR_OSError, "[Errno %d]", error));
} else {
// http://docs.python.org/3/library/io.html#io.RawIOBase.write
// "None is returned if the raw stream is set not to block and no single byte could be readily written to it."