Skip to content

Commit cb651ca

Browse files
firemaiself
authored andcommitted
Handle windows case where tty is redirected.
Make github actions handle push.
1 parent 3eb39bd commit cb651ca

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Build
22

33
on:
4+
push:
45
pull_request:
56
workflow_dispatch:
67
inputs:

lib/godot/_internal/utils/doc_utils.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _remove_sgr(text: str) -> str:
5959

6060
def reformat_doc_bbcode(text: str, for_tty: None | bool = None) -> str:
6161
if for_tty is None:
62-
for_tty = sys.stdout.isatty()
62+
for_tty = sys.stdout.isatty() if sys.stdout else False
6363

6464
replacements = _replacements_for_tty if for_tty else _replacements
6565

@@ -82,11 +82,9 @@ def replace(match_):
8282
return f'{replacements.get("b", "")}{name}{replacements.get("_b", "")}'
8383

8484
text = re.sub(r'\[(?P<close>/)?(?P<name>[-_.\w/]+)( (?P<value>[-_.\w/]+))?\]', replace, text)
85-
text = text.replace('\n', '\n\n', 1) # separate first line from the rest by one blank line
85+
text = text.replace('\n', '\n\n', 1) # Separate first line from the rest by one blank line
8686

87-
# TODO: urls
88-
# TODO: word wrap
87+
# TODO: Handle URLs
88+
# TODO: Implement word wrap if necessary
8989

9090
return text
91-
92-

0 commit comments

Comments
 (0)