aboutsummaryrefslogtreecommitdiff
path: root/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'core.py')
-rw-r--r--core.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/core.py b/core.py
index ecbf12c..99403f1 100644
--- a/core.py
+++ b/core.py
@@ -15,6 +15,8 @@ class Core():
def __init__(self):
self.FFMPEG_BIN = self.findFfmpeg()
self.tempDir = os.path.join(tempfile.gettempdir(), 'audio-visualizer-python-data')
+ if not os.path.exists(self.tempDir):
+ os.makedirs(self.tempDir)
atexit.register(self.deleteTempDir)
def findFfmpeg(self):
@@ -94,8 +96,7 @@ class Core():
def deleteTempDir(self):
try:
- if os.path.exists(self.tempDir):
- rmtree(self.tempDir)
+ rmtree(self.tempDir)
except FileNotFoundError:
pass