
`split("\n")` includes a final empty element `""` if the final line ends with `\n` (as it should for POSIX-compliant text files), which then became an extra `"\n"`. `splitlines()` solves that, but there's a caveat, as it will split on other types of line breaks too (like `\r`), which may not be desired. Fixes #526.
14 lines
255 B
Diff
14 lines
255 B
Diff
--- [Deterministic header]
|
|
+++ [Deterministic header]
|
|
@@ -1,6 +1,5 @@
|
|
-def abc ():
|
|
- return ["hello", "world",
|
|
- "!"]
|
|
+def abc():
|
|
+ return ["hello", "world", "!"]
|
|
|
|
-print( "Incorrect formatting"
|
|
-)
|
|
+
|
|
+print("Incorrect formatting")
|