Commit 3311714f authored by Jérome Perrin's avatar Jérome Perrin

core: PythonCodeUtils python3

parent 85ebbe47
from six import string_types as basestring
import re
import six
import json
import sys
from zExceptions import ExceptionFormatter
......@@ -15,7 +15,7 @@ def checkPythonSourceCodeAsJSON(self, data, REQUEST=None):
"""
# XXX data is encoded as json, because jQuery serialize lists as []
if isinstance(data, basestring):
if isinstance(data, six.string_types):
data = json.loads(data)
# data contains the code, the bound names and the script params. From this
......@@ -49,6 +49,8 @@ def checkPythonSourceCodeAsJSON(self, data, REQUEST=None):
else:
body = data['code']
if six.PY2:
body = body.encode('utf8')
try:
message_list = checkPythonSourceCode(body.encode('utf8'), data.get('portal_type'))
except Exception:
......
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