1 |
commit: c4447175e57a8311f254cfc9fa32646467e1830f |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Mar 6 19:51:38 2017 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Mar 8 19:29:23 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=c4447175 |
7 |
|
8 |
use_reduce: reserve missing_white_space_check for invalid tokens (bug 611838) |
9 |
|
10 |
Since it's possible for a URI to contain parenthesis, only call |
11 |
missing_white_space_check for tokens that fail to validate with |
12 |
token_class. The missing_white_space_check function only serves |
13 |
to clarify exception messages, so it must not be allowed to |
14 |
reject valid tokens. |
15 |
|
16 |
X-Gentoo-Bug: 611838 |
17 |
X-Gentoo-Bug-Url: https://bugs.gentoo.org/show_bug.cgi?id=611838 |
18 |
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org> |
19 |
|
20 |
pym/portage/dep/__init__.py | 4 ++-- |
21 |
1 file changed, 2 insertions(+), 2 deletions(-) |
22 |
|
23 |
diff --git a/pym/portage/dep/__init__.py b/pym/portage/dep/__init__.py |
24 |
index 968ff5b89..6ff6adcb9 100644 |
25 |
--- a/pym/portage/dep/__init__.py |
26 |
+++ b/pym/portage/dep/__init__.py |
27 |
@@ -677,8 +677,6 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i |
28 |
need_simple_token = True |
29 |
stack[level].append(token) |
30 |
else: |
31 |
- missing_white_space_check(token, pos) |
32 |
- |
33 |
if need_bracket: |
34 |
raise InvalidDependString( |
35 |
_("expected: '(', got: '%s', token %s") % (token, pos+1)) |
36 |
@@ -698,12 +696,14 @@ def use_reduce(depstr, uselist=[], masklist=[], matchall=False, excludeall=[], i |
37 |
token = token_class(token, eapi=eapi, |
38 |
is_valid_flag=is_valid_flag) |
39 |
except InvalidAtom as e: |
40 |
+ missing_white_space_check(token, pos) |
41 |
raise InvalidDependString( |
42 |
_("Invalid atom (%s), token %s") \ |
43 |
% (e, pos+1), errors=(e,)) |
44 |
except SystemExit: |
45 |
raise |
46 |
except Exception as e: |
47 |
+ missing_white_space_check(token, pos) |
48 |
raise InvalidDependString( |
49 |
_("Invalid token '%s', token %s") % (token, pos+1)) |