Skip to content

Commit a40730a

Browse files
committed
Fix indent function
The indent function wasn't actually indenting. Add the indent to the function and fix up the one call site.
1 parent 9202021 commit a40730a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graphql/language/printer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def block(_list):
301301
# type: (List[str]) -> str
302302
"""Given a list, print each item on its own line, wrapped in an indented "{ }" block."""
303303
if _list:
304-
return indent("{\n" + join(_list, "\n")) + "\n}"
304+
return "{\n" + indent(join(_list, "\n")) + "\n}"
305305
return "{}"
306306

307307

@@ -315,5 +315,5 @@ def wrap(start, maybe_str, end=""):
315315
def indent(maybe_str):
316316
# type: (Optional[str]) -> str
317317
if maybe_str:
318-
return maybe_str.replace("\n", "\n ")
318+
return ' ' + maybe_str.replace("\n", "\n ")
319319
return ""

0 commit comments

Comments
 (0)