30 # We whitelist tests (see more messages in pyflakes.messages) |
30 # We whitelist tests (see more messages in pyflakes.messages) |
31 pats = [ |
31 pats = [ |
32 (r"imported but unused", None), |
32 (r"imported but unused", None), |
33 (r"local variable '.*' is assigned to but never used", None), |
33 (r"local variable '.*' is assigned to but never used", None), |
34 (r"unable to detect undefined names", None), |
34 (r"unable to detect undefined names", None), |
|
35 (r"undefined name '.*'", |
|
36 r"undefined name 'memoryview'") |
35 ] |
37 ] |
36 if sys.version_info >= (2, 7): |
38 |
37 pats.append((r"undefined name '.*'", None)) |
|
38 else: |
|
39 pats.append((r"undefined name '.*'", r"undefined name 'memoryview'")) |
|
40 for msgtype, (pat, excl) in enumerate(pats): |
39 for msgtype, (pat, excl) in enumerate(pats): |
41 if re.search(pat, line) and (not excl or not re.search(excl, line)): |
40 if re.search(pat, line) and (not excl or not re.search(excl, line)): |
42 break # pattern matches |
41 break # pattern matches |
43 else: |
42 else: |
44 continue # no pattern matched, next line |
43 continue # no pattern matched, next line |