Skip to content

Commit 4be9723

Browse files
Merge pull request google-research#274 from soloice/master
FIX: Python3 compatibility.
2 parents 4a47cc2 + 094e9de commit 4be9723

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tokenization_test.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ def test_full_tokenizer(self):
3131
"##ing", ","
3232
]
3333
with tempfile.NamedTemporaryFile(delete=False) as vocab_writer:
34-
vocab_writer.write("".join([x + "\n" for x in vocab_tokens]))
34+
import six
35+
if six.PY2:
36+
vocab_writer.write("".join([x + "\n" for x in vocab_tokens]))
37+
else:
38+
vocab_writer.write("".join([x + "\n" for x in vocab_tokens]).encode("utf-8"))
3539

3640
vocab_file = vocab_writer.name
3741

0 commit comments

Comments
 (0)