Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop using deprecated distutils.dep_util #108

Merged
merged 4 commits into from
Nov 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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