Skip to content
Myr

:bug: Fix group creation without name

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sebastián Ramírez · committed by Sebastián Ramírez · parent c820ba0 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:typer/main.py+2 added-2 removed
213 unmodified lines
214 return get_command_from_info(typer_instance.registered_commands[0])215 assert False, "Could not get a command for this Typer instance"216217218def get_group_name(typer_info: TyperInfo) -> str:218def get_group_name(typer_info: TyperInfo) -> Optional[str]:219 if typer_info.callback:220 # Priority 1: Callback passed in app.add_typer()221 return get_command_name(typer_info.callback.__name__)222 if typer_info.typer_instance:
3 unmodified lines
226 # Priority 2: Callback passed in @subapp.callback()227 return get_command_name(registered_callback.callback.__name__)228 if typer_info.typer_instance.info.callback:229 return get_command_name(typer_info.typer_instance.info.callback.__name__)230 assert False, "A Group name could not be created"230 return None231232233def solve_typer_info_defaults(typer_info: TyperInfo) -> TyperInfo:234 values = {}
407 unmodified lines