artiq_flash: fix a refactoring mistake.

This commit is contained in:
whitequark 2018-01-20 08:00:13 +00:00
parent c3323f0d57
commit 8598e475e9

View File

@ -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)