Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
src/sage/misc/replace_dot_all.py (make_replacements_in_file): Add opt…
Browse files Browse the repository at this point in the history
…ional arg 'output'
  • Loading branch information
Matthias Koeppe committed Jan 28, 2023
1 parent 057dfb5 commit b8b4372
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/sage/misc/replace_dot_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,9 @@ def make_replacements_in_file(location, package_regex, verbose=False, output=Non
replaced_content += new_line + "\n" # concatenate the new string and add an end-line break
row_index += 1 + span
file.close() # close the file
write_file = open(location, "w") # Open file in write mode
if output is None:
output = location
write_file = open(output, "w") # Open file in write mode
write_file.write(replaced_content) # overwriting the old file contents with the new/replaced content
write_file.close() # close the file

Expand Down

0 comments on commit b8b4372

Please sign in to comment.