aboutsummaryrefslogtreecommitdiff
path: root/py/builtinimport.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-11-16 13:17:51 +1100
committerDamien George <damien.p.george@gmail.com>2017-11-16 13:17:51 +1100
commit4601759bf59e16b860a3f082e9aa4ea78356bf92 (patch)
tree138bedf76b8b9155835bbaf935f2c108d8ff3ec0 /py/builtinimport.c
parent6bc55b657b900dd92ebb8b4a8c393644a30dd7e6 (diff)
py/objstr: Remove "make_qstr_if_not_already" arg from mp_obj_new_str.
This patch simplifies the str creation API to favour the common case of creating a str object that is not forced to be interned. To force interning of a new str the new mp_obj_new_str_via_qstr function is added, and should only be used if warranted. Apart from simplifying the mp_obj_new_str function (and making it have the same signature as mp_obj_new_bytes), this patch also reduces code size by a bit (-16 bytes for bare-arm and roughly -40 bytes on the bare-metal archs).
Diffstat (limited to 'py/builtinimport.c')
-rw-r--r--py/builtinimport.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/builtinimport.c b/py/builtinimport.c
index 04ce66723..9235e946c 100644
--- a/py/builtinimport.c
+++ b/py/builtinimport.c
@@ -434,7 +434,7 @@ mp_obj_t mp_builtin___import__(size_t n_args, const mp_obj_t *args) {
DEBUG_printf("%.*s is dir\n", vstr_len(&path), vstr_str(&path));
// https://docs.python.org/3/reference/import.html
// "Specifically, any module that contains a __path__ attribute is considered a package."
- mp_store_attr(module_obj, MP_QSTR___path__, mp_obj_new_str(vstr_str(&path), vstr_len(&path), false));
+ mp_store_attr(module_obj, MP_QSTR___path__, mp_obj_new_str(vstr_str(&path), vstr_len(&path)));
size_t orig_path_len = path.len;
vstr_add_char(&path, PATH_SEP_CHAR);
vstr_add_str(&path, "__init__.py");