14 import traceback |
14 import traceback |
15 import multiprocessing |
15 import multiprocessing |
16 |
16 |
17 try: |
17 try: |
18 from pyflakes.checker import Checker |
18 from pyflakes.checker import Checker |
19 from pyflakes.messages import ImportStarUsed |
19 from pyflakes.messages import ImportStarUsed, ImportStarUsage |
20 except ImportError: |
20 except ImportError: |
21 pass |
21 pass |
22 |
22 |
23 VcsConflictMarkerRe = re.compile( |
23 VcsConflictMarkerRe = re.compile( |
24 r"""^<<<<<<< .*?=======.*?>>>>>>> .*?$""", |
24 r"""^<<<<<<< .*?=======.*?>>>>>>> .*?$""", |
273 lines = codestring.splitlines() |
273 lines = codestring.splitlines() |
274 try: |
274 try: |
275 warnings = Checker(module, filename, withDoctest=True) |
275 warnings = Checker(module, filename, withDoctest=True) |
276 warnings.messages.sort(key=lambda a: a.lineno) |
276 warnings.messages.sort(key=lambda a: a.lineno) |
277 for warning in warnings.messages: |
277 for warning in warnings.messages: |
278 if ignoreStarImportWarnings and \ |
278 if ignoreStarImportWarnings and ( |
279 isinstance(warning, ImportStarUsed): |
279 isinstance(warning, ImportStarUsed) or |
|
280 isinstance(warning, ImportStarUsage) |
|
281 ): |
280 continue |
282 continue |
281 |
283 |
282 _fn, lineno, col, message, msg_args = warning.getMessageData() |
284 _fn, lineno, col, message, msg_args = warning.getMessageData() |
283 if "__IGNORE_WARNING__" not in extractLineFlags( |
285 if "__IGNORE_WARNING__" not in extractLineFlags( |
284 lines[lineno - 1].strip()): |
286 lines[lineno - 1].strip()): |