From 0502fe7a1fbf89765895524aac66b76fcc560807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Tue, 24 Dec 2019 18:04:31 +0100 Subject: [PATCH] :bug: Fix group creation without name --- typer/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typer/main.py b/typer/main.py index 0b19f62..4d970f7 100644 --- a/typer/main.py +++ b/typer/main.py @@ -215,7 +215,7 @@ def get_command(typer_instance: Typer) -> click.Command: assert False, "Could not get a command for this Typer instance" -def get_group_name(typer_info: TyperInfo) -> str: +def get_group_name(typer_info: TyperInfo) -> Optional[str]: if typer_info.callback: # Priority 1: Callback passed in app.add_typer() return get_command_name(typer_info.callback.__name__) @@ -227,7 +227,7 @@ def get_group_name(typer_info: TyperInfo) -> str: return get_command_name(registered_callback.callback.__name__) if typer_info.typer_instance.info.callback: return get_command_name(typer_info.typer_instance.info.callback.__name__) - assert False, "A Group name could not be created" + return None def solve_typer_info_defaults(typer_info: TyperInfo) -> TyperInfo: