File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -399,7 +399,7 @@ def block(strings: Optional[Strings]) -> str:
399
399
Given a collection of strings, return a string with each item on its own line,
400
400
wrapped in an indented "{ }" block.
401
401
"""
402
- return "{\n " + indent (join (strings , "\n " )) + "\n }" if strings else ""
402
+ return wrap ( "{\n " , indent (join (strings , "\n " )), "\n }" )
403
403
404
404
405
405
def wrap (start : str , string : Optional [str ], end : str = "" ) -> str :
@@ -417,7 +417,7 @@ def indent(string: str) -> str:
417
417
If the string is not None or empty, add two spaces at the beginning of every line
418
418
inside the string.
419
419
"""
420
- return " " + string .replace ("\n " , "\n " ) if string else string
420
+ return wrap ( " " , string .replace ("\n " , "\n " ))
421
421
422
422
423
423
def is_multiline (string : str ) -> bool :
You can’t perform that action at this time.
0 commit comments