forked from loafle/openapi-generator-original
[python] Convert unicode to six.u (#6881)
`unicode` does not exist in py3, therefore since six is already imported switch to using `six.u` so that `unicode` is used on py2 and `str` is used on py3.
This commit is contained in:
@@ -44,7 +44,7 @@ def _deserialize_primitive(data, klass):
|
||||
try:
|
||||
value = klass(data)
|
||||
except UnicodeEncodeError:
|
||||
value = unicode(data)
|
||||
value = six.u(data)
|
||||
except TypeError:
|
||||
value = data
|
||||
return value
|
||||
|
||||
Reference in New Issue
Block a user