Skip to content

Commit c9ee08d

Browse files
committed
Refactor: move helper function down
1 parent 8de15ea commit c9ee08d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Doc/tools/extensions/availability.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,6 @@
5252
KNOWN_PLATFORMS = _PLATFORMS | _LIBC | _THREADING
5353

5454

55-
def _print_platform(
56-
platform: str, version: str | bool
57-
) -> str | Callable[[str], str]:
58-
if version is True:
59-
return platform
60-
if not version:
61-
return sphinx_gettext("not {platform}").format(platform=platform)
62-
return f"{platform}{version}"
63-
64-
6555
class Availability(SphinxDirective):
6656
has_content = True
6757
required_arguments = 1
@@ -132,6 +122,16 @@ def parse_platforms(self) -> dict[str, str | bool]:
132122
return platforms
133123

134124

125+
def _print_platform(
126+
platform: str, version: str | bool
127+
) -> str | Callable[[str], str]:
128+
if version is True:
129+
return platform
130+
if not version:
131+
return sphinx_gettext("not {platform}").format(platform=platform)
132+
return f"{platform}{version}"
133+
134+
135135
def setup(app: Sphinx) -> ExtensionMetadata:
136136
app.add_directive("availability", Availability)
137137

0 commit comments

Comments
 (0)