commit:     c4447175e57a8311f254cfc9fa32646467e1830f
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Mar  6 19:51:38 2017 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Mar  8 19:29:23 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c4447175

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 <AT> gentoo.org>

 pym/portage/dep/__init__.py | 4 ++--
 1 file 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))
 

Reply via email to