-
-
Notifications
You must be signed in to change notification settings - Fork 144
Open
Description
Lines 227 to 232 in f8704ec
| try: | |
| module = importlib.import_module(module_path) | |
| except Exception as e: | |
| msg = f'Error importing {module!r}: {e.__class__.__name__}: {e}' | |
| if not skip_errors: | |
| raise ImportError(msg) |
Change raise ImportError(msg) to raise ImportError(msg) from e:
try:
module = importlib.import_module(module_path)
except Exception as e:
msg = f'Error importing {module!r}: {e.__class__.__name__}: {e}'
if not skip_errors:
raise ImportError(msg) from eThis improves exceptions readability.
I didn't search for other places in the repository, there're probably more places where raise x from y would be useful.
kernc
Metadata
Metadata
Assignees
Labels
No labels