handle queue exception
@@ -47,6 +47,7 @@ def background(inputQueue, outputQueue):
pid = os.getpid()
signalNumber = signal.SIGUSR1
while True:
+ try:
try:
program, message = inputQueue.get(block)
if message == 'quit':
@@ -56,8 +57,10 @@ def background(inputQueue, outputQueue):
program.render()
outputQueue.put(app.render.frame.grabFrame())
os.kill(pid, signalNumber)
- #if not inputQueue.empty():
- # continue
+ if not inputQueue.empty():
+ continue
+ except Queue.Empty:
+ pass
tb = program.focusedWindow.textBuffer
if not tb.parser:
block = True
@@ -68,7 +71,6 @@ def background(inputQueue, outputQueue):
tb.parser.parse(tb.data, tb.rootGrammar,
len(tb.parser.rows),
len(tb.lines))
- #tb.parseGrammars()
block = len(tb.parser.rows) >= len(tb.lines)
if block:
program.render()
