Skip to content

Commit

Permalink
Fix py35 issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
c0fec0de committed Sep 4, 2016
1 parent 4612389 commit de255fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions anytree/dotexport.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ def to_picture(self, filename):
*`graphviz` needs to be installed, before usage of this method.*
"""
fileformat = path.splitext(filename)[1][1:]
with NamedTemporaryFile("w") as dotfile:
with NamedTemporaryFile("wb") as dotfile:
for line in self:
dotfile.write("%s\n".encode("utf-8") % line)
dotfile.write(("%s\n" % line).encode("utf-8"))
dotfile.flush()
cmd = ["dot", dotfile.name, "-T", fileformat, "-o", filename]
check_call(cmd)
Expand Down

0 comments on commit de255fa

Please sign in to comment.