Commit 0a6264dc authored by Jason R. Coombs's avatar Jason R. Coombs

Prevent StopIteration from bubbling up in parse_requirements. Fixes #1285.

parent 5da3a845
v38.5.2
-------
* #1285: Fixed RuntimeError in pkg_resources.parse_requirements
on Python 3.7 (stemming from PEP 479).
v38.5.1 v38.5.1
------- -------
......
...@@ -3035,7 +3035,10 @@ def parse_requirements(strs): ...@@ -3035,7 +3035,10 @@ def parse_requirements(strs):
# If there is a line continuation, drop it, and append the next line. # If there is a line continuation, drop it, and append the next line.
if line.endswith('\\'): if line.endswith('\\'):
line = line[:-2].strip() line = line[:-2].strip()
line += next(lines) try:
line += next(lines)
except StopIteration:
return
yield Requirement(line) yield Requirement(line)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment