summaryrefslogtreecommitdiff
path: root/py/builtinimport.c
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2021-05-30 19:25:53 +1000
committerDamien George <damien@micropython.org>2021-05-30 19:35:03 +1000
commit53519e322a5a0bb395676cdaa132f5e82de22909 (patch)
treeea718dbfd5e1142f2a99683d9f8c3738f0d27fa6 /py/builtinimport.c
parentc3199f56494429ba44f7e722597945dc91f3589c (diff)
py/builtinimport: Change relative import's ValueError to ImportError.
Following CPython change, see https://bugs.python.org/issue37444. Signed-off-by: Damien George <damien@micropython.org>
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 874d2dd7f..abbeefced 100644
--- a/py/builtinimport.c
+++ b/py/builtinimport.c
@@ -313,7 +313,7 @@ mp_obj_t mp_builtin___import__(size_t n_args, const mp_obj_t *args) {
// We must have some component left over to import from
if (p == this_name) {
- mp_raise_ValueError(MP_ERROR_TEXT("can't perform relative import"));
+ mp_raise_msg(&mp_type_ImportError, MP_ERROR_TEXT("can't perform relative import"));
}
uint new_mod_l = (mod_len == 0 ? (size_t)(p - this_name) : (size_t)(p - this_name) + 1 + mod_len);