We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ab30a7 commit 199d237Copy full SHA for 199d237
Lib/textwrap.py
@@ -433,7 +433,7 @@ def dedent(text):
433
434
lines = text.split("\n")
435
436
- margin = os.path.commonprefix(tuple(filter(lambda x: x.lstrip(), lines)))
+ margin = os.path.commonprefix([line for line in lines if line.lstrip()])
437
margin_len = len(margin) - len(margin.lstrip())
438
439
return "\n".join([line[margin_len:] if line.lstrip() else "\n" if line.endswith("\n") else "" for line in lines])
0 commit comments