Skip to content

Commit

Permalink
Fix indent function
Browse files Browse the repository at this point in the history
The indent function wasn't actually indenting. Add the indent to
the function and fix up the one call site.
  • Loading branch information
phil303 committed Dec 8, 2018
1 parent 9202021 commit a40730a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions graphql/language/printer.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def block(_list):
# type: (List[str]) -> str
"""Given a list, print each item on its own line, wrapped in an indented "{ }" block."""
if _list:
return indent("{\n" + join(_list, "\n")) + "\n}"
return "{\n" + indent(join(_list, "\n")) + "\n}"
return "{}"


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

0 comments on commit a40730a

Please sign in to comment.