Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit 562f062

Browse files
committed
Fixed bug when --clean is used with tm-format and no generator.* is present
1 parent c66ad88 commit 562f062

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

python/formats/ioi_format/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class IOIFormat(TaskFormat):
2424
"""
2525

2626
@staticmethod
27-
def clean():
27+
def clean(has_generator=None):
2828
"""
2929
Remove all the generated files, eventually removing also the
3030
corresponding directory.
@@ -49,7 +49,7 @@ def remove_file(path: str) -> None:
4949
except OSError:
5050
pass
5151

52-
if get_generator():
52+
if has_generator or get_generator():
5353
remove_dir("input", "*.txt")
5454
remove_dir("output", "*.txt")
5555
remove_dir("bin", "*")

python/formats/tm_format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ def clean():
384384
Perform the cleanup for a task-maker task. Removes all the files of a
385385
ioi-format task, and removes also gen/GEN only if auto-generated.
386386
"""
387-
ioi_format.IOIFormat.clean()
387+
ioi_format.IOIFormat.clean(has_generator=True)
388388
if os.path.exists("gen/GEN"):
389389
with open("gen/GEN") as f:
390390
if "tm-allow-delete" not in f.read():

0 commit comments

Comments
 (0)