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 | |
| parent | 5da3a845683ded446cad8af009d3ab9f264a944f (diff) | |
| download | external_python_setuptools-0a6264dc11a7c692f2444825da2bf91078dcb118.tar.gz external_python_setuptools-0a6264dc11a7c692f2444825da2bf91078dcb118.tar.bz2 external_python_setuptools-0a6264dc11a7c692f2444825da2bf91078dcb118.zip | |
Prevent StopIteration from bubbling up in parse_requirements. Fixes #1285.
| -rw-r--r-- | CHANGES.rst | 6 | ||||
| -rw-r--r-- | pkg_resources/__init__.py | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/CHANGES.rst b/CHANGES.rst index 1b515f55..e518b199 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -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 ------- 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) |
