Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard next(inter) #701

Merged
merged 2 commits into from
Apr 3, 2020
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
24 changes: 18 additions & 6 deletions src/rosdep2/platforms/debian.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,32 @@ def _read_apt_cache_showpkg(packages, exec_fn=None):

header = 'Package: %s' % p
# proceed to Package header
while next(lines) != header:
try:
while next(lines) != header:
pass
except StopIteration:
pass

# proceed to versions section
while next(lines) != 'Versions: ':
try:
while next(lines) != 'Versions: ':
pass
except StopIteration:
pass

# virtual packages don't have versions
if next(lines) != '':
yield p, False, None
continue
try:
if next(lines) != '':
yield p, False, None
continue
except StopIteration:
break

# proceed to reserve provides section
while next(lines) != 'Reverse Provides: ':
try:
while next(lines) != 'Reverse Provides: ':
pass
except StopIteration:
pass

pr = [line.split(' ', 2)[0] for line in lines]
Expand Down