未验证 提交 ed66d9ad 编写于 作者: C Cleber Rosa

Merge remote-tracking branch 'apahim/master_bug_echo_v3'

......@@ -18,6 +18,7 @@ The core Avocado application.
import os
import signal
import sys
from .parser import Parser
from . import output
......@@ -54,7 +55,21 @@ class AvocadoApp(object):
self.parser.finish()
if self.cli_dispatcher.extensions:
self.cli_dispatcher.map_method('run', self.parser.args)
finally:
except SystemExit as e:
# If someonte tries to exit Avocado, we should first close the
# STD_OUTPUT and only then exit.
setattr(self.parser.args, 'paginator', 'off')
output.reconfigure(self.parser.args)
STD_OUTPUT.close()
sys.exit(e.code)
except:
# For any other exception we also need to close the STD_OUTPUT.
setattr(self.parser.args, 'paginator', 'off')
output.reconfigure(self.parser.args)
STD_OUTPUT.close()
raise
else:
# In case of no exceptions, we just reconfigure the output.
output.reconfigure(self.parser.args)
def run(self):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册