Skip to content
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
12 changes: 7 additions & 5 deletions src/judge0/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@

JUDGE0_IMPLICIT_CE_CLIENT = None
JUDGE0_IMPLICIT_EXTRA_CE_CLIENT = None
SUPPRESS_PREVIEW_WARNING = os.getenv("JUDGE0_SUPPRESS_PREVIEW_WARNING")

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -106,11 +107,12 @@ def _get_implicit_client(flavor: Flavor) -> Client:


def _get_preview_client(flavor: Flavor) -> Union[Judge0CloudCE, Judge0CloudExtraCE]:
logger.warning(
"You are using a preview version of the client which is not recommended"
" for production.\n"
"For production, please specify your API key in the environment variable."
)
if SUPPRESS_PREVIEW_WARNING is not None:
logger.warning(
"You are using a preview version of the client which is not recommended"
" for production.\n"
"For production, please specify your API key in the environment variable."
)

if flavor == Flavor.CE:
return Judge0CloudCE()
Expand Down