diff options
author | Marco Pesenti Gritti <mpgritti@gmail.com> | 2008-10-04 22:28:20 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpgritti@gmail.com> | 2008-10-04 22:28:20 (GMT) |
commit | 32d1ef49dcbbdbe1a1977fafc351a62c43a50b23 (patch) | |
tree | ebbe3c903cead9d80dc8f910cc75ac847625b9c3 /scripts | |
parent | 0f5c90179ac23b3b49a872a56983d2d5c4c5d2f1 (diff) |
Launching multiple pylints with the same xfvb causes crashes.
Work around by lanching a fresh Xfvb for each pylint.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/check.py | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/scripts/check.py b/scripts/check.py index 9a61975..c7f1839 100644 --- a/scripts/check.py +++ b/scripts/check.py @@ -99,11 +99,20 @@ class cmd_check(Command): return None def lint(self, module): - subprocess.call(['pylint', module, '--rcfile=%s' % pylintrc_path]) + xvfb_pid = self.start_xvfb() + try: + subprocess.call(['pylint', module, '--rcfile=%s' % pylintrc_path]) + finally: + os.kill(xvfb_pid, signal.SIGTERM) def check_ui(self, config): - ui_check = UICheck() - return ui_check.start() + xvfb_pid = self.start_xvfb() + try: + result = UICheck().start() + finally: + os.kill(xvfb_pid, signal.SIGTERM) + + return result def check_pylint(self, config): print 'Pylint the sugar module...' @@ -126,16 +135,11 @@ class cmd_check(Command): def run(self, config, options, args): result = 0 - xvfb_pid = self.start_xvfb() - try: - if not options.type or options.type == 'pylint': - self.check_pylint(config) - if not options.type or options.type == 'ui': - result = self.check_ui(config) - finally: - if xvfb_pid: - os.kill(xvfb_pid, signal.SIGTERM) + if not options.type or options.type == 'pylint': + self.check_pylint(config) + if not options.type or options.type == 'ui': + result = self.check_ui(config) return result |