Skip to content

Commit 30cecf4

Browse files
fix: delete function that was merged wrongly after merge conflict
1 parent be95663 commit 30cecf4

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

grader_service/autograding/local_grader.py

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@
1717
from sqlalchemy.orm import Session
1818
from traitlets.config import Config
1919
from traitlets.config.configurable import LoggingConfigurable
20-
from traitlets.traitlets import Callable, Int, TraitError, Unicode, validate
20+
from traitlets.traitlets import Callable, Int, TraitError, Type, Unicode, validate
2121

2222
from grader_service.autograding.git_manager import GitSubmissionManager
2323
from grader_service.autograding.utils import collect_logs, executable_validator, rmtree
2424
from grader_service.convert.converters.autograde import Autograde
2525
from grader_service.convert.gradebook.models import GradeBookModel
2626
from grader_service.orm.assignment import Assignment
27-
from grader_service.orm.lecture import Lecture
2827
from grader_service.orm.submission import AutoStatus, ManualStatus, Submission
2928
from grader_service.orm.submission_logs import SubmissionLogs
3029
from grader_service.orm.submission_properties import SubmissionProperties
@@ -327,32 +326,6 @@ def _cleanup(self) -> None:
327326
if self.close_session:
328327
self.session.close()
329328

330-
def _run_subprocess(self, command: str, cwd: str) -> subprocess.CompletedProcess:
331-
"""
332-
Execute the command as a subprocess.
333-
:param command: The command to execute as a string.
334-
:param cwd: The working directory the subprocess should run in.
335-
:return: CompletedProcess object which contains information about the execution.
336-
"""
337-
try:
338-
result = subprocess.run(
339-
shlex.split(command),
340-
stdout=subprocess.PIPE,
341-
stderr=subprocess.PIPE,
342-
cwd=cwd,
343-
text=True, # Decodes output to string
344-
check=True, # Raises a CalledProcessError on non-zero exit code
345-
)
346-
return result
347-
except subprocess.CalledProcessError as e:
348-
self.grading_logs = e.stderr
349-
self.log.error(self.grading_logs)
350-
raise
351-
except Exception as e:
352-
self.grading_logs = (self.grading_logs or "") + str(e)
353-
self.log.error(e)
354-
raise
355-
356329
def _determine_cell_timeout(self):
357330
cell_timeout = self.default_cell_timeout
358331
if self.assignment.settings.cell_timeout is not None:

0 commit comments

Comments
 (0)