aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2017-03-06 11:51:38 -0800
committerZac Medico <zmedico@gentoo.org>2017-03-08 11:29:23 -0800
commitc4447175e57a8311f254cfc9fa32646467e1830f (patch)
tree904af55ac4e7aca7648763f7e90aeaf3f819ebbe
parentemerge: auto-enable --with-bdeps if --usepkg is not enabled (bug 598444) (diff)
downloadportage-c4447175e57a8311f254cfc9fa32646467e1830f.tar.gz
portage-c4447175e57a8311f254cfc9fa32646467e1830f.tar.bz2
portage-c4447175e57a8311f254cfc9fa32646467e1830f.zip
use_reduce: reserve missing_white_space_check for invalid tokens (bug 611838)
Since it's possible for a URI to contain parenthesis, only call missing_white_space_check for tokens that fail to validate with token_class. The missing_white_space_check function only serves to clarify exception messages, so it must not be allowed to reject valid tokens. X-Gentoo-Bug: 611838 X-Gentoo-Bug-Url: https://bugs.gentoo.org/show_bug.cgi?id=611838 Acked-by: Brian Dolbec <dolsen@gentoo.org>
-rw-r--r--pym/portage/dep/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py
index 968ff5b89..6ff6adcb9 100644
--- a/pym/portage/dep/__init__.py
+++ b/pym/portage/dep/__init__.py
@@ -677,8 +677,6 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i
need_simple_token = True
stack[level].append(token)
else:
- missing_white_space_check(token, pos)
-
if need_bracket:
raise InvalidDependString(
_("expected: '(', got: '%s', token %s") % (token, pos+1))
@@ -698,12 +696,14 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i
token = token_class(token, eapi=eapi,
is_valid_flag=is_valid_flag)
except InvalidAtom as e:
+ missing_white_space_check(token, pos)
raise InvalidDependString(
_("Invalid atom (%s), token %s") \
% (e, pos+1), errors=(e,))
except SystemExit:
raise
except Exception as e:
+ missing_white_space_check(token, pos)
raise InvalidDependString(
_("Invalid token '%s', token %s") % (token, pos+1))