Skip to content

Commit

Permalink
stop using deprecated distutils.dep_util (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
altendky authored Nov 20, 2023
1 parent 9032699 commit 3091f4b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions clvm_tools/clvmc.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# clvm_tools setuptools integration

from distutils import log
from distutils.dep_util import newer

import os
import pathlib
Expand All @@ -22,7 +21,13 @@ def compile_clvm_text(text, search_paths):


def compile_clvm(input_path, output_path, search_paths=[]):
if newer(input_path, output_path):
input_path = pathlib.Path(input_path)
output_path = pathlib.Path(output_path)
try:
output_time = output_path.stat().st_mtime
except FileNotFoundError:
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 3091f4b

Please sign in to comment.