Commit 6fe887e5 authored by Yong Tang's avatar Yong Tang
Browse files

Fix tf.compat.as_str returns bytes issue in Python 3



This fix tries to address the issue raised in 18598 where
tf.compat.as_str returns bytes (vs. str) in Python 3.
The issue was that `tf_export` decorator:
```
@tf_export('compat.as_bytes', 'compat.as_str')
```
could not be assigned to `as_bytes` or `as_text`
based on python 2 or 3.
This fix invokes tf_export explicitly based on `_six.PY2`
(for python 2/3) so that `as_str` calls `as_bytes` or `as_text`
conditionally.

This fix fixes 18598.

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>
parent 3128b43e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment