Commit 03397964 authored by Jérome Perrin's avatar Jérome Perrin

yapf: support non ascii code

parent 208417cd
......@@ -4,9 +4,11 @@ def ERP5Site_formatPythonSourceCode(self, code):
from yapf.yapflib.yapf_api import FormatCode
try:
return FormatCode(
code, style_config={
unicode(code, 'utf8'),
style_config={
'indent_width': 2,
'based_on_style': 'pep8'
})[0]
'based_on_style': 'pep8',
# 'SPLIT_BEFORE_FIRST_ARGUMENT': True # XXX not sure about this one
})[0].encode('utf8')
except SyntaxError, _:
return code
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