From: whitequark Date: Sun, 12 Apr 2020 04:56:15 +0000 (+0000) Subject: build.run: fix BuildProducts.extract to work with subdirectories. X-Git-Tag: working_23jun2020~11 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=91d6e4b22ad63cd140034f0433371890ea846b80;p=nmigen.git build.run: fix BuildProducts.extract to work with subdirectories. Fixes #353. --- diff --git a/nmigen/build/run.py b/nmigen/build/run.py index a32f38e..93aa4df 100644 --- a/nmigen/build/run.py +++ b/nmigen/build/run.py @@ -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()