File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
pyannotate_tools/annotations Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 44import json
55import logging
66import os
7+ import sys
78
89from lib2to3 .main import StdoutRefactoringTool
910
@@ -78,6 +79,10 @@ def main(args_override=None):
7879 args = parser .parse_args (args_override )
7980 if not args .files and not args .dump :
8081 parser .error ("At least one file/directory is required" )
82+ try :
83+ open (args .type_info ).close ()
84+ except OSError as err :
85+ sys .exit ("Can't open type info file: %s" % err )
8186
8287 # Set up logging handler.
8388 level = logging .DEBUG if args .verbose else logging .INFO
@@ -88,8 +93,7 @@ def main(args_override=None):
8893 return
8994
9095 # Run pass 2 with output into a variable.
91- infile = args .type_info
92- data = generate_annotations_json_string (infile ) # type: List[Any]
96+ data = generate_annotations_json_string (args .type_info ) # type: List[Any]
9397
9498 # Run pass 3 with input from that variable.
9599 if args .auto_any :
You can’t perform that action at this time.
0 commit comments