Check whether logdir exists before creating it

This commit is contained in:
2019-02-01 11:06:27 +01:00
parent 00646d0135
commit 9bfc30d31d
+1
View File
@@ -30,6 +30,7 @@ def generate_scenario(out_path, name):
shutil.copyfile(os.path.join(STATICDIR, 'simul.sumocfg'), os.path.join(out_path, f'{name}.sumocfg'))
# Move log files
logdir = os.path.join(out_path, 'log')
if not os.path.exists(logdir):
os.mkdir(logdir)
for f in os.listdir(STATICDIR):
if f.endswith('.log'):