Commit c5899bf5 authored by Kento HASEGAWA's avatar Kento HASEGAWA
Browse files

Avoid confliction on temporary file names

parent 230bc3fe
Loading
Loading
Loading
Loading
+3 −1
Changes for kwmr_solver.py: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ import argparse
import os
import random
import subprocess
import uuid

proc = None
stop_flag = False
@@ -28,7 +29,8 @@ def solve(params):

    basedir = os.path.abspath(os.path.dirname(__file__))

    solution_filepath = f'{basedir}/a.txt'
    aid = str(uuid.uuid4())
    solution_filepath = f'{basedir}/A{aid}.txt'
    if os.path.exists(solution_filepath):
        os.remove(solution_filepath)