Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions rpmlint/pkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,18 +409,18 @@ def _calc_magic(self, pkgfile):
# internal function to gather dependency info used by the above ones
def _gather_aux(self, header, xs, nametag, flagstag, versiontag,
prereq=None):
names = header[nametag]
flags = header[flagstag]
versions = header[versiontag]

if versions:
for loop in range(len(versions)):
name = byte_to_string(names[loop])
evr = stringToVersion(byte_to_string(versions[loop]))
if prereq is not None and flags[loop] & PREREQ_FLAG:
prereq.append((name, flags[loop] & (~PREREQ_FLAG), evr))
names = header[nametag]
flags = header[flagstag]
for version, name_bytes, flag in zip(versions, names, flags):

@vil02 vil02 Aug 20, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually I would use:

Suggested change
for version, name_bytes, flag in zip(versions, names, flags):
for version, name_bytes, flag in zip(versions, names, flags, strict=True):

This is available starting from python 3.10 (cf. PEP618) and this project claims to work for any python starting from 3.8:

- Python 3.8 or newer

name = byte_to_string(name_bytes)
evr = stringToVersion(byte_to_string(version))
if prereq is not None and flag & PREREQ_FLAG:
prereq.append((name, flag & (~PREREQ_FLAG), evr))
else:
xs.append(DepInfo(name, flags[loop], evr))
xs.append(DepInfo(name, flag, evr))
return xs, prereq

def _gather_dep_info(self):
Expand Down
Loading