Skip to content

Commit

Permalink
misc. cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom O'Hara committed Oct 8, 2023
1 parent dbebebe commit 24e3a86
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions mezcla/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,6 @@ def write_file(filename, text, skip_newline=False, append=False, binary=False):
debug.trace_fmt(7, "write_file({f}, {t})", f=filename, t=text)
# EX: f = "/tmp/_it.list"; write_file(f, "it"); read_file(f) => "it\n"
# EX: write_file(f, "it", skip_newline=True); read_file(f) => "it"
## OLD: debug.assertion(isinstance(text, str))
text_type = (bytes if binary else str)
debug.assertion(isinstance(text, text_type))
try:
Expand All @@ -715,7 +714,6 @@ def write_file(filename, text, skip_newline=False, append=False, binary=False):
enc = (None if binary else "UTF-8")
debug.trace_expr(5, mode, enc)
with open(filename, encoding=enc, mode=mode) as f:
## OLD: f.write(to_utf8(text))
f.write(text)
if not (binary or text.endswith("\n")):
if not skip_newline:
Expand Down

0 comments on commit 24e3a86

Please sign in to comment.