:param dict add_files: a dictionary of additional files XeTeX will need
"""
- from StringIO import StringIO
+ from io import BytesIO
import shutil
from tempfile import mkdtemp
import subprocess
from django.template.loader import render_to_string
rendered = render_to_string(template, context)
- texml = StringIO(rendered.encode('utf-8'))
+ texml = BytesIO(rendered.encode('utf-8'))
tempdir = mkdtemp(prefix="render_to_pdf-")
tex_path = os.path.join(tempdir, "doc.tex")
with open(tex_path, 'w') as tex_file: