check if docker is installed if user_docker is True (#1145)

This commit is contained in:
Eric Zhu 2024-01-04 18:34:59 -08:00 committed by GitHub
parent 871e9e28b3
commit 55b03bfac6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -272,6 +272,11 @@ def execute_code(
logger.error(error_msg)
raise AssertionError(error_msg)
if use_docker and docker is None:
error_msg = "Cannot use docker because the python docker package is not available."
logger.error(error_msg)
raise AssertionError(error_msg)
# Warn if use_docker was unspecified (or None), and cannot be provided (the default).
# In this case the current behavior is to fall back to run natively, but this behavior
# is subject to change.