From da31d298979623f90fdc560b304c2972b9498a0c Mon Sep 17 00:00:00 2001 From: whitequark Date: Wed, 24 Feb 2016 21:43:46 +0000 Subject: [PATCH] compiler: fix ARTIQ_DUMP_*. --- artiq/compiler/targets.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/artiq/compiler/targets.py b/artiq/compiler/targets.py index 304251a77..591fad7c5 100644 --- a/artiq/compiler/targets.py +++ b/artiq/compiler/targets.py @@ -46,11 +46,12 @@ class RunTool: def _dump(target, kind, suffix, content): if target is not None: print("====== {} DUMP ======".format(kind.upper()), file=sys.stderr) + content_bytes = bytes(content(), 'utf-8') if target == "": - file = tempfile.NamedTemporaryFile(suffix, delete=False) + file = tempfile.NamedTemporaryFile(suffix=suffix, delete=False) else: file = open(target + suffix, "wb") - file.write(content()) + file.write(content_bytes) file.close() print("{} dumped as {}".format(kind, file.name), file=sys.stderr)