Commit 3202fcb0 authored by Jérome Perrin's avatar Jérome Perrin

Merge remote-tracking branch 'upstream/master' into zope4py2

parents c812c18d b21f83fc
......@@ -300,7 +300,8 @@
<tr>
<td>openAndWait</td>
<td>${base_url}</td>
<!-- Access some publicly-accessible document from a context expexted to trigger erp5_xthtml_style rendering -->
<td>${base_url}/portal_categories</td>
<td></td>
</tr>
......
......@@ -81,8 +81,16 @@ def checkComponent(component_instance):
code = component_instance.getTextContent()
if six.PY2:
code = unicode(code, 'utf8')
for annotation in json.loads(portal.ERP5Site_checkPythonSourceCodeAsJSON(
{'code': code}))['annotations']:
data = {'code': code}
try:
check_result_json = portal.ERP5Site_checkPythonSourceCodeAsJSON(data)
except Exception:
# pylint sometimes raises on the first attempt at importing modules, but
# may succeed on the second try (probably because of incomplete cleanup
# of partially imported moduled). We are not interested in pylint issues,
# we are interested in our code's issues, so give it one more try.
check_result_json = portal.ERP5Site_checkPythonSourceCodeAsJSON(data)
for annotation in json.loads(check_result_json)['annotations']:
annotation['component_path'] = component_relative_url
line_list.append(
Message(
......
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