From fcd8f581f39aeb9ec00081e6861e0880a6d92868 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