File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -427,16 +427,15 @@ def dedent(text):
427427
428428 Entirely blank lines are normalized to a newline character.
429429 """
430- # Fast paths for empty or simple text
431430 if not text :
432431 return text
433432
434433 lines = text .split ("\n " )
435434
436- margin = os .path .commonprefix ([line for line in lines if line .lstrip ()])
435+ margin = os .path .commonprefix ([line for line in lines if line .strip ()])
437436 margin_len = len (margin ) - len (margin .lstrip ())
438437
439- return "\n " .join ([line [margin_len :] if line .lstrip () else "\n " if line and line [- 1 ] == "\n " else "" for line in lines ])
438+ return "\n " .join ([line [margin_len :] if line .strip () else "\n " if line and line [- 1 ] == "\n " else "" for line in lines ])
440439
441440
442441def indent (text , prefix , predicate = None ):
You can’t perform that action at this time.
0 commit comments