Skip to content

Commit d63f726

Browse files
committed
Fix race condition creating log directory
1 parent 068f85e commit d63f726

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: OoTRandomizer.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ def start() -> None:
2626
ts = time.time()
2727
st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d %H-%M-%S')
2828
log_dir = local_path('Logs')
29-
if not os.path.exists(log_dir):
30-
os.makedirs(log_dir)
29+
os.makedirs(log_dir, exist_ok=True)
3130
log_path = os.path.join(log_dir, '%s.log' % st)
3231
log_file = logging.FileHandler(log_path)
3332
log_file.setFormatter(logging.Formatter('[%(asctime)s] %(message)s', datefmt='%H:%M:%S'))

0 commit comments

Comments
 (0)