Skip to content

Conversation

@hermanzdosilovic
Copy link
Member

Hi @fkdosilovic,

The intention for this PR is to be able to deliberately disable (suppress) preview warning by either setting env variable JUDGE0_SUPPRESS_PREVIEW_WARNING to any value or by explicitly setting judge0.suppress_preview_warning = True.

Here are examples that work with these changes:

Example 1

# File example.py
import judge0
result = judge0.run(source_code="print('hello, world')", language=judge0.PYTHON)
print(result.stdout)

Any of these would cause the preview warning to be suppressed:

JUDGE0_SUPPRESS_PREVIEW_WARNING=True python3 example.py
JUDGE0_SUPPRESS_PREVIEW_WARNING=1 python3 example.py
JUDGE0_SUPPRESS_PREVIEW_WARNING=asdf python3 example.py
JUDGE0_SUPPRESS_PREVIEW_WARNING= python3 example.py

Example 2

import judge0
judge0.suppress_preview_warning = True
result = judge0.run(source_code="print('hello, world')", language=judge0.PYTHON)
print(result.stdout)

I don't know if this is idiomatic way of doing this in Python. If it's not, please adjust the PR accordingly such that the above can be achieved.

Thank you!

@fkdosilovic fkdosilovic self-assigned this Nov 9, 2025
@fkdosilovic
Copy link
Collaborator

LGTM

@fkdosilovic fkdosilovic merged commit 6eb3069 into master Nov 9, 2025
1 check passed
@fkdosilovic fkdosilovic deleted the hermanzdosilovic/suppress_preview_warning branch November 9, 2025 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants