diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2018-03-05 15:59:28 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2018-03-05 15:59:28 -0500 |
| commit | 0a6264dc11a7c692f2444825da2bf91078dcb118 (patch) | |
| tree | ac8e78336b31e154f8b3ba56657d40d3572236d8 /pkg_resources/__init__.py | |
| parent | 5da3a845683ded446cad8af009d3ab9f264a944f (diff) | |
| download | python-setuptools-git-0a6264dc11a7c692f2444825da2bf91078dcb118.tar.gz | |
Prevent StopIteration from bubbling up in parse_requirements. Fixes #1285.
Diffstat (limited to 'pkg_resources/__init__.py')
| -rw-r--r-- | pkg_resources/__init__.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index 062b82c6..c9b2d251 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -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) |
