diff --git a/CHANGELOG.md b/CHANGELOG.md index 2069534..f5595cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### 0.5.4 - Fix incorrect index creation order. (#151) +- Not catch exception when import config. (#164) ### 0.5.3 diff --git a/aerich/utils.py b/aerich/utils.py index 8e4f337..5b32599 100644 --- a/aerich/utils.py +++ b/aerich/utils.py @@ -42,13 +42,7 @@ def get_tortoise_config(ctx: Context, tortoise_orm: str) -> dict: splits = tortoise_orm.split(".") config_path = ".".join(splits[:-1]) tortoise_config = splits[-1] - try: - config_module = importlib.import_module(config_path) - except (ModuleNotFoundError, AttributeError): - raise BadOptionUsage( - ctx=ctx, message=f'No config named "{config_path}"', option_name="--config" - ) - + config_module = importlib.import_module(config_path) config = getattr(config_module, tortoise_config, None) if not config: raise BadOptionUsage(