Skip to content

Commit 663ef33

Browse files
committed
Fixed removing newlines
1 parent 035aa8d commit 663ef33

File tree

1 file changed

+2
-2
lines changed
  • interpreter/core/computer/terminal/languages

1 file changed

+2
-2
lines changed

interpreter/core/computer/terminal/languages/java.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def run(self, code):
4545
class_name = match.group(1)
4646
file_name = f"{class_name}.java"
4747

48-
# Write the Java code to a file
49-
with open(file_name, "w") as file:
48+
# Write the Java code to a file, preserving newlines
49+
with open(file_name, "w", newline='\n') as file:
5050
file.write(code)
5151

5252
# Compile the Java code

0 commit comments

Comments
 (0)