Skip to content

Commit

Permalink
FIX(yahoo#13): BUG in plot-diagram writtin from PY2 era,
Browse files Browse the repository at this point in the history
were writing in text-mode in PY3. and failing as encoding error.
  • Loading branch information
ankostis committed Sep 29, 2019
1 parent 617e577 commit f58d148
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions graphkit/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,8 @@ def get_node_name(a):

# save plot
if filename:
basename, ext = os.path.splitext(filename)
with open(filename, "w") as fh:
_basename, ext = os.path.splitext(filename)
with open(filename, "wb") as fh:
if ext.lower() == ".png":
fh.write(g.create_png())
elif ext.lower() == ".dot":
Expand Down

0 comments on commit f58d148

Please sign in to comment.