aboutsummaryrefslogtreecommitdiffstats
path: root/mako/runtime.py
diff options
context:
space:
mode:
Diffstat (limited to 'mako/runtime.py')
-rw-r--r--mako/runtime.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mako/runtime.py b/mako/runtime.py
index f57087f..dfd701a 100644
--- a/mako/runtime.py
+++ b/mako/runtime.py
@@ -645,13 +645,13 @@ def _render(template, callable_, args, data, as_unicode=False):
if as_unicode:
buf = util.FastEncodingBuffer(unicode=True)
- elif template.output_encoding:
+ elif template.bytestring_passthrough:
+ buf = util.StringIO()
+ else:
buf = util.FastEncodingBuffer(
unicode=as_unicode,
encoding=template.output_encoding,
errors=template.encoding_errors)
- else:
- buf = util.StringIO()
context = Context(buf, **data)
context._outputting_as_unicode = as_unicode
context._with_template = template