Skip to content

Commit 69cd531

Browse files
committed
Fix compatibility with click 8.3.0+
click 8.3.0 replaced None with a Sentinel.UNSET object for unset parameter defaults. Use to_info_dict() which normalizes UNSET to None across all supported click versions.
1 parent 97b63bd commit 69cd531

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

mkdocs_click/_docs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,8 @@ def _format_table_option_row(option: click.Option) -> str:
332332

333333
# -> `False`
334334
none_default_msg = "_required" if option.required else "None"
335-
default = f"`{option.default}`" if option.default is not None else none_default_msg
335+
default_value = option.to_info_dict().get("default")
336+
default = f"`{default_value}`" if default_value is not None else none_default_msg
336337

337338
# -> "| `-V`, `--version` / `--show-version` | boolean | Show version info. | `False` |"
338339
return f"| {names} | {value_type} | {description} | {default} |"

0 commit comments

Comments
 (0)