Skip to content

Commit 2ea7d2b

Browse files
committed
uefi_index.py: fix pylint warnings
Fix a couple of pylint W0102 warnings (dangerous-default-value). Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
1 parent 93627ca commit 2ea7d2b

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

source/extensions/uefi_index.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import os
55
import csv
6-
from typing import Any, Callable, TypedDict
6+
from typing import Any, Callable, TypedDict, Optional
77
from docutils import nodes
88
from sphinx.util import logging
99

@@ -51,13 +51,20 @@ def create_role(ref: str, index: IndexType) -> RoleType:
5151
"""
5252
def role(
5353
name: str, rawtext: str, text: str, lineno: int, inliner: Any,
54-
options: dict[Any, Any] = {}, content: list[str] = []
54+
options: Optional[dict[Any, Any]] = None,
55+
content: Optional[list[str]] = None
5556
) -> tuple[list[Any], list[str]]:
5657

5758
logger.debug(
5859
f"{ref} {name} {rawtext} {text} {lineno} {inliner} {options} "
5960
f"{content}")
6061

62+
if options is None:
63+
options = {}
64+
65+
if content is None:
66+
content = []
67+
6168
# Query the index.
6269
if text in index:
6370
title = index[text]['title']

0 commit comments

Comments
 (0)