Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.

Commit 3740f2e

Browse files
cclaussCopybara-Service
authored and
Copybara-Service
committed
internal merge of PR #1321
PiperOrigin-RevId: 227918987
1 parent ef12bee commit 3740f2e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tensor2tensor/data_generators/text_encoder.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,13 @@ def unicode_to_native(s):
7878

7979

8080
def is_unicode(s):
81-
return isinstance(s, six.text_type)
81+
if six.PY2:
82+
if isinstance(s, unicode):
83+
return True
84+
else:
85+
if isinstance(s, str):
86+
return True
87+
return False
8288

8389

8490
def to_unicode(s, ignore_errors=False):

0 commit comments

Comments
 (0)