summaryrefslogtreecommitdiff
path: root/coverage/templite.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2010-03-13 20:12:05 -0500
committerNed Batchelder <ned@nedbatchelder.com>2010-03-13 20:12:05 -0500
commit78e2e6eb38d229cfcd4d0202f27761cd5bab2495 (patch)
tree93866af62ea60710682aaa5a6e709b55cd29b69b /coverage/templite.py
parent543ff12a09952b132abd9aa863d4170c4e2523f4 (diff)
parenta5e4aa218a749f9ea73bccea4cac92bd35387451 (diff)
downloadpython-coveragepy-78e2e6eb38d229cfcd4d0202f27761cd5bab2495.tar.gz
Merged Ben Finney's use-os-path-module fixes (again?)
Diffstat (limited to 'coverage/templite.py')
-rw-r--r--coverage/templite.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/coverage/templite.py b/coverage/templite.py
index d3c673c..c39e061 100644
--- a/coverage/templite.py
+++ b/coverage/templite.py
@@ -101,14 +101,14 @@ class Templite(object):
# Run it through an engine, and return the result.
engine = _TempliteEngine(ctx)
engine.execute(self.ops)
- return engine.result
+ return "".join(engine.result)
class _TempliteEngine(object):
"""Executes Templite objects to produce strings."""
def __init__(self, context):
self.context = context
- self.result = ""
+ self.result = []
def execute(self, ops):
"""Execute `ops` in the engine.
@@ -118,10 +118,10 @@ class _TempliteEngine(object):
"""
for op, args in ops:
if op == 'lit':
- self.result += args
+ self.result.append(args)
elif op == 'exp':
try:
- self.result += str(self.evaluate(args))
+ self.result.append(str(self.evaluate(args)))
except:
exc_class, exc, _ = sys.exc_info()
new_exc = exc_class("Couldn't evaluate {{ %s }}: %s"