@@ -151,15 +151,15 @@ def testReadLines(self):
151
151
# the underlying byte offsets (counting \r). Multibyte characters would
152
152
# similarly cause desynchronization.
153
153
raw_ckpt_lines = (
154
- [u "\r \n " ] + [u "line {}\r \n " .format (i ) for i in range (10 )] + [u " " ]
154
+ ["\r \n " ] + ["line {}\r \n " .format (i ) for i in range (10 )] + [" " ]
155
155
)
156
156
expected_ckpt_lines = ( # without \r
157
- [u "\n " ] + [u "line {}\n " .format (i ) for i in range (10 )] + [u " " ]
157
+ ["\n " ] + ["line {}\n " .format (i ) for i in range (10 )] + [" " ]
158
158
)
159
159
# Write out newlines as given (i.e., \r\n) regardless of OS, so as to
160
160
# test translation on read.
161
161
with io .open (ckpt_path , "w" , newline = "" ) as f :
162
- data = u "" .join (raw_ckpt_lines )
162
+ data = "" .join (raw_ckpt_lines )
163
163
f .write (data )
164
164
with gfile .GFile (ckpt_path , "r" ) as f :
165
165
f .buff_chunk_size = 4 # Test buffering by reducing chunk size
@@ -194,7 +194,7 @@ def testWrite(self):
194
194
temp_dir = self .get_temp_dir ()
195
195
self ._CreateDeepDirectoryStructure (temp_dir )
196
196
ckpt_path = os .path .join (temp_dir , "model2.ckpt" )
197
- ckpt_content = u "asdfasdfasdffoobarbuzz"
197
+ ckpt_content = "asdfasdfasdffoobarbuzz"
198
198
with gfile .GFile (ckpt_path , "w" ) as f :
199
199
f .write (ckpt_content )
200
200
with open (ckpt_path , "r" ) as f :
@@ -205,9 +205,9 @@ def testOverwrite(self):
205
205
temp_dir = self .get_temp_dir ()
206
206
self ._CreateDeepDirectoryStructure (temp_dir )
207
207
ckpt_path = os .path .join (temp_dir , "model2.ckpt" )
208
- ckpt_content = u "asdfasdfasdffoobarbuzz"
208
+ ckpt_content = "asdfasdfasdffoobarbuzz"
209
209
with gfile .GFile (ckpt_path , "w" ) as f :
210
- f .write (u "original" )
210
+ f .write ("original" )
211
211
with gfile .GFile (ckpt_path , "w" ) as f :
212
212
f .write (ckpt_content )
213
213
with open (ckpt_path , "r" ) as f :
@@ -218,7 +218,7 @@ def testWriteMultiple(self):
218
218
temp_dir = self .get_temp_dir ()
219
219
self ._CreateDeepDirectoryStructure (temp_dir )
220
220
ckpt_path = os .path .join (temp_dir , "model2.ckpt" )
221
- ckpt_content = u "asdfasdfasdffoobarbuzz" * 5
221
+ ckpt_content = "asdfasdfasdffoobarbuzz" * 5
222
222
with gfile .GFile (ckpt_path , "w" ) as f :
223
223
for i in range (0 , len (ckpt_content ), 3 ):
224
224
f .write (ckpt_content [i : i + 3 ])
@@ -233,7 +233,7 @@ def testWriteEmpty(self):
233
233
temp_dir = self .get_temp_dir ()
234
234
self ._CreateDeepDirectoryStructure (temp_dir )
235
235
ckpt_path = os .path .join (temp_dir , "model2.ckpt" )
236
- ckpt_content = u ""
236
+ ckpt_content = ""
237
237
with gfile .GFile (ckpt_path , "w" ) as f :
238
238
f .write (ckpt_content )
239
239
with open (ckpt_path , "r" ) as f :
0 commit comments