Skip to content

Commit

Permalink
Add a timeout when calling constructor --help
Browse files Browse the repository at this point in the history
  • Loading branch information
nkaretnikov committed Jan 28, 2024
1 parent ae06519 commit 6aa7d74
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ def action_generate_constructor_installer(
version: str,
):
# Helpers
def print_cmd(cmd):
def print_cmd(cmd, **kwargs):
context.log.info(f"Running command: {' '.join(cmd)}")
context.log.info(
subprocess.check_output(cmd, stderr=subprocess.STDOUT, encoding="utf-8")
subprocess.check_output(
cmd, stderr=subprocess.STDOUT, encoding="utf-8", **kwargs
)
)

def write_file(filename, s):
Expand All @@ -44,7 +46,7 @@ def write_file(filename, s):
"constructor",
"--help",
]
print_cmd(command)
print_cmd(command, timeout=10)
except FileNotFoundError:
warnings.warn(
"Installer generation requires constructor: https://github.com/conda/constructor"
Expand Down

0 comments on commit 6aa7d74

Please sign in to comment.