File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -126,11 +126,12 @@ def run(self):
126
126
127
127
# decompress stuff
128
128
try :
129
- size = len (chunk .data )
129
+ data = chunk .data
130
+ size = len (data )
130
131
if size > job .shm .size :
131
132
logger .fatal ('Downloaded chunk is longer than SharedMemorySegment!' )
132
133
133
- self .shm .buf [job .shm .offset :job .shm .offset + size ] = bytes ( chunk . data )
134
+ self .shm .buf [job .shm .offset :job .shm .offset + size ] = data
134
135
del chunk
135
136
self .o_q .put (DownloaderTaskResult (success = True , size_decompressed = size ,
136
137
size_downloaded = compressed , ** job .__dict__ ))
@@ -271,7 +272,7 @@ def run(self):
271
272
if j .shared_memory :
272
273
shm_offset = j .shared_memory .offset + j .chunk_offset
273
274
shm_end = shm_offset + j .chunk_size
274
- current_file .write (self .shm .buf [shm_offset :shm_end ]. tobytes () )
275
+ current_file .write (self .shm .buf [shm_offset :shm_end ])
275
276
elif j .cache_file :
276
277
with open (os .path .join (self .cache_path , j .cache_file ), 'rb' ) as f :
277
278
if j .chunk_offset :
You can’t perform that action at this time.
0 commit comments