From 8598e475e92ab72347d1fa20e1296745d245e217 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sat, 20 Jan 2018 08:00:13 +0000 Subject: [PATCH] artiq_flash: fix a refactoring mistake. --- artiq/frontend/artiq_flash.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artiq/frontend/artiq_flash.py b/artiq/frontend/artiq_flash.py index 7019a7a0e..3520357e6 100755 --- a/artiq/frontend/artiq_flash.py +++ b/artiq/frontend/artiq_flash.py @@ -298,8 +298,8 @@ def main(): if not os.access(gateware_bin, os.R_OK): bin_handle, gateware_bin = tempfile.mkstemp() gateware_bit = artifact_path("gateware", "top.bit") - with open(gateware_bit, "rb") as bit_handle: - bit2bin(bit_handle, bin_handle) + with open(gateware_bit, "rb") as bit_file, open(bin_handle, "wb") as bin_file: + bit2bin(bit_file, bin_file) atexit.register(lambda: os.unlink(gateware_bin)) programmer.flash_binary(*config["gateware"], gateware_bin)