summaryrefslogtreecommitdiff
path: root/py/builtinimport.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-02-16 12:10:13 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-02-16 12:11:03 +0200
commit078172dcaba52fe46e50fdc32175764d9c027ad7 (patch)
treed8f65df9f5902667b78bd7badeb2ed0795154d74 /py/builtinimport.c
parente8432b3c725f90eda2b880624d5408ff147d399e (diff)
builtinimport: Improve debugging output.
Diffstat (limited to 'py/builtinimport.c')
-rw-r--r--py/builtinimport.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/py/builtinimport.c b/py/builtinimport.c
index 3fd517ead..e15c1cf84 100644
--- a/py/builtinimport.c
+++ b/py/builtinimport.c
@@ -61,8 +61,8 @@ bool mp_obj_is_package(mp_obj_t module) {
}
STATIC mp_import_stat_t stat_dir_or_file(vstr_t *path) {
- //printf("stat %s\n", vstr_str(path));
mp_import_stat_t stat = mp_import_stat(vstr_null_terminated_str(path));
+ DEBUG_printf("stat %s: %d\n", vstr_str(path), stat);
if (stat == MP_IMPORT_STAT_DIR) {
return stat;
}
@@ -204,6 +204,7 @@ mp_obj_t mp_builtin___import__(mp_uint_t n_args, const mp_obj_t *args) {
// package's __init__.py does something like "import .submod". So,
// maybe we should check for package here? But quote above doesn't
// talk about packages, it talks about dot-less module names.
+ DEBUG_printf("Warning: no dots in current module name and level>0\n");
p = this_name + this_name_l;
} else if (level != 0) {
nlr_raise(mp_obj_new_exception_msg(&mp_type_ImportError, "Invalid relative import"));
@@ -264,7 +265,7 @@ mp_obj_t mp_builtin___import__(mp_uint_t n_args, const mp_obj_t *args) {
// create a qstr for the module name up to this depth
qstr mod_name = qstr_from_strn(mod_str, i);
DEBUG_printf("Processing module: %s\n", qstr_str(mod_name));
- DEBUG_printf("Previous path: %.*s\n", vstr_len(&path), vstr_str(&path));
+ DEBUG_printf("Previous path: =%.*s=\n", vstr_len(&path), vstr_str(&path));
// find the file corresponding to the module name
mp_import_stat_t stat;