From d572416e819cc710b85784193d788bef8057059f Mon Sep 17 00:00:00 2001 From: Quantum Date: Sun, 3 Dec 2017 18:26:33 -0500 Subject: [PATCH] Make GCC and VC preserve environment; #243 --- dmoj/executors/VC.py | 4 +++- dmoj/executors/gcc_executor.py | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dmoj/executors/VC.py b/dmoj/executors/VC.py index aa986f811..13923a2cf 100644 --- a/dmoj/executors/VC.py +++ b/dmoj/executors/VC.py @@ -56,4 +56,6 @@ def get_compile_env(self): return VC_COMPILE def get_env(self): - return VC_ENV + env = super(Executor, self).get_env() + env.update(VC_ENV) + return env diff --git a/dmoj/executors/gcc_executor.py b/dmoj/executors/gcc_executor.py index 2e19815d7..8f7f04e66 100644 --- a/dmoj/executors/gcc_executor.py +++ b/dmoj/executors/gcc_executor.py @@ -2,8 +2,6 @@ import re from collections import deque -import six - from dmoj.judgeenv import env from dmoj.result import Result from dmoj.utils.unicode import utf8bytes, utf8text @@ -77,7 +75,9 @@ def get_security(self, launch_kwargs=None): ) def get_env(self): - return GCC_ENV + env = super(GCCExecutor, self).get_env() + env.update(GCC_ENV) + return env def get_feedback(self, stderr, result, process): if not result.result_flag & Result.RTE or not stderr or len(stderr) > 2048: