Commit 9f5f2ac2 authored by Jason R. Coombs's avatar Jason R. Coombs

Simplify implementation of Requirement.parse.

parent 351f51dc
......@@ -2983,12 +2983,8 @@ class Requirement:
@staticmethod
def parse(s):
reqs = list(parse_requirements(s))
if reqs:
if len(reqs) == 1:
return reqs[0]
raise ValueError("Expected only one requirement", s)
raise ValueError("No requirements found", s)
req, = parse_requirements(s)
return req
def _get_mro(cls):
......
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