mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-11-04 14:49:58 +08:00
15 lines
341 B
Python
15 lines
341 B
Python
# coding=utf-8
|
|
import commands
|
|
|
|
|
|
class CompileError(Exception):
|
|
pass
|
|
|
|
|
|
def compile_(language_item, src_path, exe_path):
|
|
command = language_item["compile_command"].format(src_path=src_path, exe_path=exe_path)
|
|
status, output = commands.getstatusoutput(command)
|
|
if status:
|
|
raise CompileError(output)
|
|
return exe_path
|