Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions pytype/tools/analyze_project/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,16 @@ def main():
import_graph = importlab.graph.ImportGraph.create(
env, conf.inputs, trim=True)
unreadable_inputs = conf.inputs & import_graph.unreadable_files
assert not unreadable_inputs, '\n '.join(
unreadable_python_inputs = {filename for filename in unreadable_inputs if filename.endswith('.py')}
assert not unreadable_python_inputs, '\n '.join(
['Unparseable in Python %s:' % conf.python_version] +
sorted(unreadable_inputs))
sorted(unreadable_python_inputs))
except Exception as e: # pylint: disable=broad-except
logging.critical('Cannot parse input files:\n%s', str(e))
logging.critical('Cannot parse input files:\n%s', e)
sys.exit(1)

conf.inputs -= unreadable_inputs

if args.tree:
print('Source tree:')
importlab.output.print_tree(import_graph)
Expand Down