Chromium Code Reviews| Index: net/tools/dafsa/make_dafsa.py |
| diff --git a/net/tools/dafsa/make_dafsa.py b/net/tools/dafsa/make_dafsa.py |
| index 78358effa840d7b072875f1198f502ad39fb96f9..0a41603ef0c694d4ec382d2a441dbe9c4ab93bef 100755 |
| --- a/net/tools/dafsa/make_dafsa.py |
| +++ b/net/tools/dafsa/make_dafsa.py |
| @@ -448,10 +448,10 @@ def parse_gperf(infile): |
| for line in lines: |
| if line[-3:-1] != ', ': |
| raise InputError('Expected "domainname, <digit>", found "%s"' % line) |
| - # Technically the DAFSA format could support return values in range [0-31], |
| - # but the values below are the only with a defined meaning. |
| - if line[-1] not in '0124': |
| - raise InputError('Expected value to be one of {0,1,2,4}, found "%s"' % |
| + # Technically the DAFSA format can support return values in the range |
| + # [0-31], but only the first three bits have any defined meaning. |
| + if line[-1] not in map(str, range(0, 7)): |
|
M-A Ruel
2016/03/03 22:19:43
That's an relatively expensive call to do at every
|
| + raise InputError('Expected value to be in the range of 0-7, found "%s"' % |
| line[-1]) |
| return [line[:-3] + line[-1] for line in lines] |