Skip to content

Commit

Permalink
handle non-existant output file
Browse files Browse the repository at this point in the history
  • Loading branch information
altendky committed Nov 20, 2023
1 parent a9365fc commit 709b5a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion clvm_tools/clvmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ def compile_clvm_text(text, search_paths):
def compile_clvm(input_path, output_path, search_paths=[]):
input_path = pathlib.Path(input_path)
output_path = pathlib.Path(output_path)
if input_path.stat().st_mtime > output_path.stat().st_mtime:
try:
output_time = output_path.stat().st_mtime
except distutils.errors.DistutilsFileError:
output_time = None
if output_time is None or input_path.stat().st_mtime > output_time:
log.info("clvmcc %s -o %s" % (input_path, output_path))
with open(input_path) as f:
text = f.read()
Expand Down

0 comments on commit 709b5a4

Please sign in to comment.