build.run: fix BuildProducts.extract to work with subdirectories.

Fixes #353.
This commit is contained in:
whitequark 2020-04-12 04:56:15 +00:00
parent 7a08901117
commit 91d6e4b22a

View file

@ -136,8 +136,9 @@ class BuildProducts(metaclass=ABCMeta):
# On Windows, a named temporary file (as created by Python) is not accessible to
# others if it's still open within the Python process, so we close it and delete
# it manually.
file = tempfile.NamedTemporaryFile(prefix="nmigen_", suffix="_" + filename,
delete=False)
file = tempfile.NamedTemporaryFile(
prefix="nmigen_", suffix="_" + os.path.basename(filename),
delete=False)
files.append(file)
file.write(self.get(filename))
file.close()