From 10f4207e9122f82eb1542461ee03125e87f051ac Mon Sep 17 00:00:00 2001 From: Harmon Date: Tue, 12 Jan 2021 13:41:31 -0600 Subject: [PATCH] Improve variable names in API.chunked_upload --- tweepy/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tweepy/api.py b/tweepy/api.py index cebb3ed..cc0b9da 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -299,14 +299,14 @@ class API: chunk_size = max(min(chunk_size, MAX_CHUNKSIZE), MIN_CHUNKSIZE) fsize = os.path.getsize(filename) - nloops = int(fsize / chunk_size / 1024.0) + (1 if fsize % chunk_size > 0 else 0) + segments = int(fsize / chunk_size / 1024.0) + (1 if fsize % chunk_size > 0 else 0) - for i in range(nloops): + for segment_index in range(segments): # The APPEND command returns an empty response body self.chunked_upload_append( media_info.media_id, (os.path.basename(filename), fp.read(chunk_size * 1024)), - i, *args, **kwargs + segment_index, *args, **kwargs ) # When all chunks have been sent, we can finalize. fp.close() -- 2.25.1