diff options
author | Damien George <damien.p.george@gmail.com> | 2014-03-15 14:33:09 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-03-15 14:33:09 +0000 |
commit | 280e7208d8b8bc7abc8d5d6a49abc0977004ee56 (patch) | |
tree | e0b8a3e219eeb98d3f618e1f57864868387d75af /py/builtinimport.c | |
parent | 8b96af69077d2c9b4e523e78497e639fde1efc68 (diff) | |
download | micropython-280e7208d8b8bc7abc8d5d6a49abc0977004ee56.tar.gz micropython-280e7208d8b8bc7abc8d5d6a49abc0977004ee56.zip |
Add vstr_ins and vstr_cut_out; improve stmhal readline.
Diffstat (limited to 'py/builtinimport.c')
-rw-r--r-- | py/builtinimport.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/py/builtinimport.c b/py/builtinimport.c index e64ca82374..7cbb46012b 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -211,13 +211,13 @@ mp_obj_t mp_builtin___import__(int n_args, mp_obj_t *args) { vstr_add_char(&path, PATH_SEP_CHAR); vstr_add_str(&path, "__init__.py"); if (mp_import_stat(vstr_str(&path)) != MP_IMPORT_STAT_FILE) { - vstr_cut_tail(&path, sizeof("/__init__.py") - 1); // cut off /__init__.py + vstr_cut_tail_bytes(&path, sizeof("/__init__.py") - 1); // cut off /__init__.py nlr_jump(mp_obj_new_exception_msg_varg(&mp_type_ImportError, "Per PEP-420 a dir without __init__.py (%s) is a namespace package; " "namespace packages are not supported", vstr_str(&path))); } do_load(module_obj, &path); - vstr_cut_tail(&path, sizeof("/__init__.py") - 1); // cut off /__init__.py + vstr_cut_tail_bytes(&path, sizeof("/__init__.py") - 1); // cut off /__init__.py } else { // MP_IMPORT_STAT_FILE do_load(module_obj, &path); // TODO: We cannot just break here, at the very least, we must execute |