Commit 003ec65e authored by Benjamin Fischer's avatar Benjamin Fischer
Browse files

codeeditor: fixed abort handling

parent af780912
...@@ -31,6 +31,7 @@ class CodeEditorRpc: ...@@ -31,6 +31,7 @@ class CodeEditorRpc:
self._thread = None self._thread = None
self._kill = False self._kill = False
self._abort = False
self._popen = None self._popen = None
...@@ -64,6 +65,8 @@ class CodeEditorRpc: ...@@ -64,6 +65,8 @@ class CodeEditorRpc:
self._base = expand(base) self._base = expand(base)
self._starttime = time.time() self._starttime = time.time()
self._read_amount = 0 self._read_amount = 0
self._kill = False
self._abort = False
try: try:
self._popen = Popen( self._popen = Popen(
...@@ -124,13 +127,8 @@ class CodeEditorRpc: ...@@ -124,13 +127,8 @@ class CodeEditorRpc:
else: else:
returncode = -signal.SIGKILL returncode = -signal.SIGKILL
# check remaing data # send remaing data
read_burst = min( self._send("data", self._popen.communicate()[0])
int(self.MAX_RATE * self.BURST_DELAY),
self.MAX_BURST
)
while self._read(read_burst):
pass
returncode = self._popen.poll() returncode = self._popen.poll()
runtime = round(time.time() - self._starttime, 2) runtime = round(time.time() - self._starttime, 2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment