replace use of 'unicode' builtin
The builtin type 'unicode' does not exist under python 3. The runtime check here is already looking at the python version, but the linter does not perform the same check and it fails because the name is not defined. Replace the explicit use of unicode here with six.text_type so that the linter is happy. Change-Id: I22a13fddaed1338c0f3e670d199bb6aa5f99bbf7 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
parent
c0b8fd801f
commit
0153a20201
|
@ -28,8 +28,8 @@ def serialize_envelope(envelope):
|
|||
json = rest_utils.as_json(envelope, ensure_ascii=False)
|
||||
|
||||
if six.PY2:
|
||||
raw = unicode(json.replace(r'\\', r'\\\\'), encoding='utf-8',
|
||||
errors='replace')
|
||||
raw = six.text_type(json.replace(r'\\', r'\\\\'), encoding='utf-8',
|
||||
errors='replace')
|
||||
else:
|
||||
raw = json
|
||||
|
||||
|
|
Loading…
Reference in New Issue