diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-06-05 20:02:15 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-06-05 20:06:15 +0300 |
commit | 75ce9256b2c70bceee6ced26ac7c7bcbd1f1d7f4 (patch) | |
tree | e397a2e3c922a3e3290b022157296e232eb6b556 /py/builtinimport.c | |
parent | 1e82ef3ae8fd8c7570b3c2094fa8b129b354dcdd (diff) |
objstr: Implement "%(key)s" % {} formatting for strings and dicts.
Also, make sure that args to "*" format specifiers are bounds-checked
properly and don't lead for segfaults in case of mismatch.
Diffstat (limited to 'py/builtinimport.c')
-rw-r--r-- | py/builtinimport.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/py/builtinimport.c b/py/builtinimport.c index 50780c01d..c6910138f 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -163,16 +163,6 @@ void do_load(mp_obj_t module_obj, vstr_t *file) { mp_globals_set(old_globals); } -// TODO: Move to objdict? -STATIC inline mp_obj_t mp_obj_dict_get(mp_obj_t dict_in, mp_obj_t key) { - mp_obj_dict_t *dict = dict_in; - mp_map_elem_t *elem = mp_map_lookup(&dict->map, key, MP_MAP_LOOKUP); - if (elem == NULL) { - return elem; - } - return elem->value; -} - mp_obj_t mp_builtin___import__(uint n_args, mp_obj_t *args) { #if DEBUG_PRINT printf("__import__:\n"); |