Browse Source

Use a more reliable way to create directories

Using os.makedirs will raise an exception if
it fails to create the directory, os.system
on the other hand will just print a warning,
thus the application will fail down the road
due missing directories.
Alexandre Vicenzi 6 years ago
parent
commit
e2a080509f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app_utils.py

+ 1 - 1
app_utils.py

@@ -106,7 +106,7 @@ def clean_all(files):
 
 
 def create_directory(path):
-    os.system("mkdir -p %s" % os.path.dirname(path))
+    os.makedirs(os.path.dirname(path), exist_ok=True)
 
 
 def get_model_bin(url, output_path):