Skip to content

Commit

Permalink
Fixed runtime errors' dialog boxes.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffswt committed Apr 4, 2017
1 parent f174207 commit f275413
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
4 changes: 3 additions & 1 deletion pyjudge/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,9 @@ def __init__(self, source_path, source_type=None):
r'.txt$': 'Text',
r'.in$': 'Text', # De-facto standards by CCF
r'.out$': 'Text', # De-facto standards by CCF
r'.(in|out)\*$': 'Directory', # De-facto standards by CCF and pyJudge
r'.ans$': 'Text', # De-facto standards by CCF
r'.std$': 'Text', # Non-standard
r'.(in|out|ans|std)\*$': 'Directory', # De-facto standards by CCF and pyJudge
r'.cpp$': 'C++',
r'.c\+\+$': 'C++',
r'.c$': 'C',
Expand Down
1 change: 1 addition & 0 deletions pyjudge/judger.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def __init__(self,
raise AttributeError('Must provide output handle')
if not stdout_handle:
raise AttributeError('Must provide standard output handle')
# Building compilers, in case they haven't been built
if type(input_handle) == str:
input_handle = compiler.AdaptiveCompiler(input_handle)
self.input_handle_is_temp = True
Expand Down
12 changes: 12 additions & 0 deletions pyjudge/process.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@

import subprocess
import sys
import threading
import time

from . import table

# http://stackoverflow.com/questions/24130623/using-python-subprocess-popen-cant-prevent-exe-stopped-working-prompt
if sys.platform.startswith('win'):
import ctypes
SEM_NOGPFAULTERRORBOX = 0x0002; # From MSDN
ctypes.windll.kernel32.SetErrorMode(SEM_NOGPFAULTERRORBOX);
CREATE_NO_WINDOW = 0x08000000; # From Windows API
platform_subprocess_flags = CREATE_NO_WINDOW
else:
platform_subprocess_flags = 0

class ProcessResult:
""" Result of process execution. """
def __init__(self,
Expand Down Expand Up @@ -65,6 +76,7 @@ def __init__(self,
def execute(self):
# Starting process
proc = subprocess.Popen(self.process_args,
creationflags=platform_subprocess_flags,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def readme():

setup(
name = 'pyjudge',
version = '0.1.75',
version = '0.1.78',
description = 'OI programs Judger in Python',
long_description = 'Judge OI programs easily with pyJudge.',
classifiers = [
Expand All @@ -21,8 +21,8 @@ def readme():
'Topic :: Education :: Testing',
],
keywords = 'judge judger oi',
url = 'https://github.com/ht35268/pyjudge',
author = 'ht35268',
url = 'https://github.com/jeffswt/pyjudge',
author = 'jeffswt',
author_email = '',
license = 'GPLv3',
packages = [
Expand Down

0 comments on commit f275413

Please sign in to comment.