From fd2ab3c80e7c6bd48d952ae63c14a817d68b8ce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herman=20Zvonimir=20Do=C5=A1ilovi=C4=87?= Date: Mon, 10 Nov 2025 21:27:04 +0100 Subject: [PATCH] Fix bug in suppressing preview warning message. --- src/judge0/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/judge0/__init__.py b/src/judge0/__init__.py index b74df46e..069c96ca 100644 --- a/src/judge0/__init__.py +++ b/src/judge0/__init__.py @@ -65,9 +65,9 @@ JUDGE0_IMPLICIT_CE_CLIENT = None JUDGE0_IMPLICIT_EXTRA_CE_CLIENT = None -SUPPRESS_PREVIEW_WARNING = os.getenv("JUDGE0_SUPPRESS_PREVIEW_WARNING") logger = logging.getLogger(__name__) +suppress_preview_warning = os.getenv("JUDGE0_SUPPRESS_PREVIEW_WARNING") is not None def _get_implicit_client(flavor: Flavor) -> Client: @@ -107,7 +107,7 @@ def _get_implicit_client(flavor: Flavor) -> Client: def _get_preview_client(flavor: Flavor) -> Union[Judge0CloudCE, Judge0CloudExtraCE]: - if SUPPRESS_PREVIEW_WARNING is not None: + if not suppress_preview_warning: logger.warning( "You are using a preview version of the client which is not recommended" " for production.\n"