From 2fe4cf7761ffc40d81b4780d59c2b6ef0a5c16ff Mon Sep 17 00:00:00 2001 From: stijn Date: Sat, 4 Oct 2014 08:51:33 +0200 Subject: Implement kwargs for builtin open() and _io.FileIO This makes open() and _io.FileIO() more CPython compliant. The mode kwarg is fully iplemented. The encoding kwarg is allowed but not implemented; mainly to allow the tests to specify encoding for CPython, see #874 --- qemu-arm/main.c | 4 ++-- qemu-arm/test_main.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'qemu-arm') diff --git a/qemu-arm/main.c b/qemu-arm/main.c index 7bb847254..1189ae7b8 100644 --- a/qemu-arm/main.c +++ b/qemu-arm/main.c @@ -70,10 +70,10 @@ mp_import_stat_t mp_import_stat(const char *path) { return MP_IMPORT_STAT_NO_EXIST; } -mp_obj_t mp_builtin_open(uint n_args, const mp_obj_t *args) { +mp_obj_t mp_builtin_open(uint n_args, const mp_obj_t *args, mp_map_t *kwargs) { return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_open_obj, 1, 2, mp_builtin_open); +MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_open_obj, 1, mp_builtin_open); void nlr_jump_fail(void *val) { } diff --git a/qemu-arm/test_main.c b/qemu-arm/test_main.c index 099cd94ba..fb9513077 100644 --- a/qemu-arm/test_main.c +++ b/qemu-arm/test_main.c @@ -78,10 +78,10 @@ mp_import_stat_t mp_import_stat(const char *path) { return MP_IMPORT_STAT_NO_EXIST; } -mp_obj_t mp_builtin_open(uint n_args, const mp_obj_t *args) { +mp_obj_t mp_builtin_open(uint n_args, const mp_obj_t *args, mp_map_t *kwargs) { return mp_const_none; } -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_open_obj, 1, 2, mp_builtin_open); +MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_open_obj, 1, mp_builtin_open); void nlr_jump_fail(void *val) { } -- cgit v1.2.3