Skip to content

Commit e1a74c5

Browse files
Reverted changes for writing pyrepl history file
1 parent 9b65418 commit e1a74c5

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

Lib/_pyrepl/readline.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -450,14 +450,8 @@ def read_history_file(self, filename: str = gethistoryfile()) -> None:
450450
def write_history_file(self, filename: str = gethistoryfile()) -> None:
451451
maxlength = self.saved_history_length
452452
history = self.get_reader().get_trimmed_history(maxlength)
453-
454-
try:
455-
f = open(os.path.expanduser(filename), "w",
456-
encoding="utf-8", newline="\n")
457-
except OSError as e:
458-
warnings.warn(f"failed to open the history file for writing: {e}")
459-
return
460-
453+
f = open(os.path.expanduser(filename), "w",
454+
encoding="utf-8", newline="\n")
461455
with f:
462456
for entry in history:
463457
entry = entry.replace("\n", "\r\n") # multiline history support

0 commit comments

Comments
 (0)