Skip to content

Commit ec4607d

Browse files
committed
Add traceback for python loading scripts.
1 parent 934ccbf commit ec4607d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

source/loaders/py_loader/source/py_loader_impl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,7 +1565,11 @@ int py_loader_impl_initialize_import(loader_impl_py py_impl)
15651565
" m = importlib.util.module_from_spec(spec)\n"
15661566
" spec.loader.exec_module(m)\n"
15671567
" return m\n"
1568+
" except ImportError as e:\n"
1569+
" return e\n"
15681570
" except Exception as e:\n"
1571+
" import traceback\n"
1572+
" print(traceback.format_exc())\n"
15691573
" return e\n"
15701574
#elif PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 3
15711575
// TODO: Not tested

0 commit comments

Comments
 (0)