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:
Doug Hellmann 2018-06-06 17:29:42 -04:00
parent c0b8fd801f
commit 0153a20201
1 changed files with 2 additions and 2 deletions

View File

@ -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