allow None in requirement

This commit is contained in:
2013-06-13 12:15:46 +02:00
parent fd02a954ca
commit 755b2312c2
2 changed files with 18 additions and 1 deletions

View File

@ -814,7 +814,7 @@ def validate_requires_arg(requires, name):
if req[0].impl_is_multi():
raise ValueError(_('malformed requirements option {0} '
'should not be a multi').format(name))
if not req[0]._validate(req[1]):
if req[1] is not None and not req[0]._validate(req[1]):
raise ValueError(_('malformed requirements second argument '
'must be valid for option {0}').format(name))
if len(req) == 3: