diff options
author | ankitjavalkar | 2019-12-27 17:58:09 +0530 |
---|---|---|
committer | GitHub | 2019-12-27 17:58:09 +0530 |
commit | 18188766cf1e91fe086ed8bfe2939d836ea92ff7 (patch) | |
tree | 34fbf78dd0fb85671746be09008d49dcfb269486 /yaksh/python_stdio_evaluator.py | |
parent | f082788af3c31e0bcc184d184fdedd4e0893136e (diff) | |
parent | 28c64f6f1771fe93385e3767d5bee9fe55af8c82 (diff) | |
download | online_test-18188766cf1e91fe086ed8bfe2939d836ea92ff7.tar.gz online_test-18188766cf1e91fe086ed8bfe2939d836ea92ff7.tar.bz2 online_test-18188766cf1e91fe086ed8bfe2939d836ea92ff7.zip |
Merge pull request #635 from ankitjavalkar/maheshgudi-fix_stdio_spacing_error
Allow new line to be added in an stdio testcase
Diffstat (limited to 'yaksh/python_stdio_evaluator.py')
-rw-r--r-- | yaksh/python_stdio_evaluator.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/yaksh/python_stdio_evaluator.py b/yaksh/python_stdio_evaluator.py index 64a2809..a1e8f72 100644 --- a/yaksh/python_stdio_evaluator.py +++ b/yaksh/python_stdio_evaluator.py @@ -46,6 +46,7 @@ class PythonStdIOEvaluator(BaseEvaluator): if self.file_paths: self.files = copy_files(self.file_paths) submitted = compile(self.user_answer, '<string>', mode='exec') + self.expected_output = self.expected_output.replace('\r', '') if self.expected_input: self.expected_input = self.expected_input.replace('\r', '') input_buffer = StringIO() @@ -55,7 +56,7 @@ class PythonStdIOEvaluator(BaseEvaluator): with redirect_stdout() as output_buffer: exec_scope = {} exec(submitted, exec_scope) - self.output_value = output_buffer.getvalue().rstrip("\n") + self.output_value = output_buffer.getvalue() return self.output_value def check_code(self): |