From 91d6e4b22ad63cd140034f0433371890ea846b80 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 12 Apr 2020 04:56:15 +0000 Subject: [PATCH] build.run: fix BuildProducts.extract to work with subdirectories. Fixes #353. --- nmigen/build/run.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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() -- 2.30.2