modified: ri_oper.py
add signal pipe
This commit is contained in:
@@ -78,6 +78,7 @@ class Operation:
|
||||
max = Rate.value+self.score <100 and Rate.value+self.score or 100
|
||||
process = subprocess.Popen("./%s " %self.script + ' '.join(self.get_arguments()),\
|
||||
stdin=subprocess.PIPE,stdout=subprocess.PIPE, shell=True, \
|
||||
preexec_fn=self.sigpipe_handle, \
|
||||
cwd="%s/../operation" %os.path.split(os.path.realpath(__file__))[0])
|
||||
process.stdin.write(self.get_stdin())
|
||||
process.stdin.close()
|
||||
@@ -96,6 +97,9 @@ class Operation:
|
||||
if display_scale: display_scale()
|
||||
return ret
|
||||
|
||||
def sigpipe_handle(self):
|
||||
signal.signal(signal.SIGPIPE,signal.SIG_DFL)
|
||||
|
||||
def get_arguments(self):
|
||||
return []
|
||||
def get_stdin(self):
|
||||
|
||||
Reference in New Issue
Block a user