Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cptbox: support subprocess.STDOUT #961

Merged
merged 2 commits into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions dmoj/cptbox/tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from dmoj.utils.unicode import utf8bytes, utf8text

PIPE = subprocess.PIPE
STDOUT = subprocess.STDOUT
log = logging.getLogger('dmoj.cptbox')

_PIPE_BUF = getattr(select, 'PIPE_BUF', 512)
Expand Down Expand Up @@ -398,6 +399,8 @@ def __init_streams(self, stdin, stdout, stderr) -> None:
self._stderr, self._child_stderr = os.pipe()
self.stderr = os.fdopen(self._stderr, 'rb')
self.stderr_needs_close = True
elif stderr == STDOUT:
self._stderr, self._child_stderr = -1, self._child_stdout
elif isinstance(stderr, int):
self._stderr, self._child_stderr = -1, stderr
elif stderr is not None:
Expand Down
3 changes: 1 addition & 2 deletions dmoj/executors/PAS.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from dmoj.cptbox.filesystem_policies import ExactFile
from dmoj.executors.compiled_executor import CompiledExecutor
from dmoj.executors.mixins import NullStdoutMixin


class Executor(NullStdoutMixin, CompiledExecutor):
class Executor(CompiledExecutor):
ext = 'pas'
name = 'PAS'
command = 'fpc'
Expand Down