Skip to content

Commit

Permalink
Prevent StopIteration from bubbling up in parse_requirements. Fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Mar 5, 2018
1 parent 5da3a84 commit 0a6264d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
v38.5.2
-------

* #1285: Fixed RuntimeError in pkg_resources.parse_requirements
on Python 3.7 (stemming from PEP 479).

v38.5.1
-------

Expand Down
5 changes: 4 additions & 1 deletion pkg_resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3035,7 +3035,10 @@ def parse_requirements(strs):
# If there is a line continuation, drop it, and append the next line.
if line.endswith('\\'):
line = line[:-2].strip()
line += next(lines)
try:
line += next(lines)
except StopIteration:
return
yield Requirement(line)


Expand Down

0 comments on commit 0a6264d

Please sign in to comment.