Commit fde93ecb authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

erp5_core: continue pylint test even if it raises an exception.

parent 89ffd637
from six import string_types as basestring from six import string_types as basestring
import re import re
import json import json
import sys
from zExceptions import ExceptionFormatter
from Products.ERP5Type.Utils import checkPythonSourceCode from Products.ERP5Type.Utils import checkPythonSourceCode
...@@ -47,7 +49,15 @@ def checkPythonSourceCodeAsJSON(self, data, REQUEST=None): ...@@ -47,7 +49,15 @@ def checkPythonSourceCodeAsJSON(self, data, REQUEST=None):
else: else:
body = data['code'] body = data['code']
try:
message_list = checkPythonSourceCode(body.encode('utf8'), data.get('portal_type')) message_list = checkPythonSourceCode(body.encode('utf8'), data.get('portal_type'))
except Exception:
message_list = [{
'type': 'E',
'row': 0,
'column': 0,
'text': 'pylint failed:\n%s' % ''.join(ExceptionFormatter.format_exception(*sys.exc_info())),
}]
for message_dict in message_list: for message_dict in message_list:
if is_script: if is_script:
message_dict['row'] = message_dict['row'] - 4 message_dict['row'] = message_dict['row'] - 4
......
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