extmod/modbtree: open(): Support "in-memory" database with filename=None.

It's not really in-memory though, just uses anonymous temporary file on
disk.
This commit is contained in:
Paul Sokolovsky 2016-06-18 01:31:57 +03:00
parent e9739e3315
commit 080137961d
1 changed files with 4 additions and 1 deletions

View File

@ -244,7 +244,10 @@ STATIC mp_obj_t mod_btree_open(size_t n_args, const mp_obj_t *pos_args, mp_map_t
{ MP_QSTR_server_side, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} },
};
const char *fname = mp_obj_str_get_str(pos_args[0]);
const char *fname = NULL;
if (pos_args[0] != mp_const_none) {
fname = mp_obj_str_get_str(pos_args[0]);
}
struct {
mp_arg_val_t server_side;