artiq_flash: fix a refactoring mistake.

pull/922/head
whitequark 2018-01-20 08:00:13 +00:00
parent c3323f0d57
commit 8598e475e9
1 changed files with 2 additions and 2 deletions

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)