Skip to content

Commit

Permalink
Fix exporter tempdir creation again (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
30350n committed Jan 9, 2024
1 parent deb7f17 commit a7b2de5
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pcb2blender_exporter/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,15 @@ def init_tempdir():
try:
shutil.rmtree(tempdir)
except OSError:
# try to delete all files first
for file in tempdir.glob("**/*"):
if file.is_file():
file.unlink()
shutil.rmtree(tempdir)
try:
# try to delete all files first
for file in tempdir.glob("**/*"):
if file.is_file():
file.unlink()
shutil.rmtree(tempdir)
except OSError:
# if this stil doesn't work, fuck it
return
tempdir.mkdir()

def hex2rgb(hex_string):
Expand Down

0 comments on commit a7b2de5

Please sign in to comment.