Skip to content

Commit a788a00

Browse files
committed
Use zinfo rather than info
1 parent 0cb8682 commit a788a00

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Lib/zipfile/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,24 +1461,24 @@ def _repack(self, zfile):
14611461
entry_offset = self._calc_initial_entry_offset(fp, data_offset)
14621462

14631463
# move file entries
1464-
for i, info in enumerate(filelist):
1464+
for i, zinfo in enumerate(filelist):
14651465
# get the total size of the entry
14661466
try:
14671467
offset = filelist[i + 1].header_offset
14681468
except IndexError:
14691469
offset = zfile.start_dir
1470-
entry_size = offset - info.header_offset
1470+
entry_size = offset - zinfo.header_offset
14711471

1472-
used_entry_size = self._calc_local_file_entry_size(fp, info)
1472+
used_entry_size = self._calc_local_file_entry_size(fp, zinfo)
14731473

14741474
# update the header and move entry data to the new position
14751475
if entry_offset > 0:
1476-
old_header_offset = info.header_offset
1477-
info.header_offset -= entry_offset
1478-
self._move_entry_data(fp, old_header_offset, info.header_offset, used_entry_size)
1476+
old_header_offset = zinfo.header_offset
1477+
zinfo.header_offset -= entry_offset
1478+
self._move_entry_data(fp, old_header_offset, zinfo.header_offset, used_entry_size)
14791479

1480-
if info._end_offset is not None:
1481-
info._end_offset = info.header_offset + used_entry_size
1480+
if zinfo._end_offset is not None:
1481+
zinfo._end_offset = zinfo.header_offset + used_entry_size
14821482

14831483
# update entry_offset for subsequent files to follow
14841484
if used_entry_size < entry_size:

0 commit comments

Comments
 (0)