Skip to content

Commit

Permalink
Fix more unicode stuff for python2
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrobenolt committed Mar 13, 2019
1 parent 7e8daeb commit 7e59041
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions jinja2cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,11 @@ def cli(opts, args):
else:
out = open(opts.outfile, "w")

if not PY3:
import codecs

out = codecs.getwriter("utf8")(out)

out.write(render(template_path, data, extensions, opts.strict))
out.flush()
return 0
Expand Down

0 comments on commit 7e59041

Please sign in to comment.