Deal with failures to open input file (fixes #50)

This commit is contained in:
Babak Farrokhi 2018-02-18 07:36:37 +03:30
parent bbff3b44f6
commit 7390514877
Signed by: farrokhi
GPG Key ID: 6B267AD85D632E9A

View File

@ -284,8 +284,12 @@ def main():
with sys.stdin as flist:
f = flist.read().splitlines()
else:
with open(inputfilename, 'rt') as flist:
f = flist.read().splitlines()
try:
with open(inputfilename, 'rt') as flist:
f = flist.read().splitlines()
except Exception as e:
print(e)
sys.exit(1)
else:
f = resolvers
if len(f) == 0: