Traceback when type_info.json not found
gvanrossum opened this issue · 0 comments
gvanrossum commented
E.g.
$ pyannotate foo
Traceback (most recent call last):
File "/usr/local/bin/pyannotate", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python3.4/site-packages/pyannotate_tools/annotations/__main__.py", line 92, in main
data = generate_annotations_json_string(infile) # type: List[Any]
File "/usr/local/lib/python3.4/site-packages/pyannotate_tools/annotations/main.py", line 51, in generate_annotations_json_string
items = parse_json(source_path)
File "/usr/local/lib/python3.4/site-packages/pyannotate_tools/annotations/parse.py", line 102, in parse_json
with open(path) as f:
FileNotFoundError: [Errno 2] No such file or directory: 'type_info.json'
$
This should give a proper error message e.g. "Raw type info file 'type_info.json' not found" instead of a traceback.