ARCH: fix propper removing of tempfile on windows

This commit is contained in:
Bernd Hahnebach
2016-08-04 14:33:31 -03:00
committed by Yorik van Havre
parent cfbde714e9
commit 8ab027b218
+2 -1
View File
@@ -537,9 +537,10 @@ def insert(filename,docname,skip=[],only=[],root=None):
# workaround to remove the bad placement: exporting/reimporting as step
if not ex[0].Placement.isNull():
import tempfile
tf = tempfile.mkstemp(suffix=".stp")[1]
fd, tf = tempfile.mkstemp(suffix=".stp")
ex[0].exportStep(tf)
f = Part.read(tf)
os.close(fd)
os.remove(tf)
else:
f = ex[0]