Commit 8e8f13c6 authored by Arnaud Fontaine's avatar Arnaud Fontaine

ZODB Components: If Pylint is not available, fallback on compile() builtin.

Likewise Pylint, compile() has no side effects as it juste compile source into
a code object which may be passed to 'exec'.
parent 1375ee8b
...@@ -293,7 +293,11 @@ class ComponentMixin(PropertyRecordableMixin, Base): ...@@ -293,7 +293,11 @@ class ComponentMixin(PropertyRecordableMixin, Base):
from pylint.lint import Run from pylint.lint import Run
from pylint.reporters.text import TextReporter from pylint.reporters.text import TextReporter
except ImportError, error: except ImportError, error:
return ['F: Cannot check Source Code: Pylint is not available (%s)' % error], [] try:
compile(source_code, '<string>', 'exec')
return [], []
except BaseException, error:
return ['F: %s' % error], []
import cStringIO import cStringIO
import tempfile import tempfile
......
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