Skip to content

Commit b525b25

Browse files
committed
get rid of loop
1 parent 0c6763c commit b525b25

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/dotenv/main.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,10 +420,8 @@ def set_header(
420420
logger.info("Ignoring empty header.")
421421
return False, header
422422

423-
header = header.replace("\n", " ")
424-
lines = textwrap.wrap(header, width=60)
425-
for i, line in enumerate(lines):
426-
lines[i] = f"# {line}\n"
423+
lines = textwrap.wrap(header.replace("\n", " "), width=60)
424+
lines = [f"# {line}\n" for line in lines]
427425
header = "".join(lines)
428426
dest.write(header)
429427

0 commit comments

Comments
 (0)