Skip to content

Commit 34db5dd

Browse files
committed
don't use the codecs lib
1 parent 448dbae commit 34db5dd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/tikzplotlib/_save.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import codecs
21
import enum
32
import pathlib
43
import tempfile
@@ -258,9 +257,8 @@ def save(
258257
:returns: None
259258
"""
260259
code = get_tikz_code(*args, filepath=filepath, **kwargs)
261-
file_handle = codecs.open(filepath, "w", encoding)
262-
file_handle.write(code)
263-
file_handle.close()
260+
with open(filepath, "w", encoding=encoding) as f:
261+
f.write(code)
264262

265263

266264
def _tex_comment(comment):

0 commit comments

Comments
 (0)