if something goes wrong, just return None.

This commit is contained in:
Alan Hamlett 2014-10-07 04:43:00 -07:00
parent 40c5656910
commit c8960e2bde

View file

@ -82,7 +82,7 @@ def number_lines_in_file(file_name):
with open(file_name, 'r', encoding='utf-8') as fh: with open(file_name, 'r', encoding='utf-8') as fh:
for line in fh: for line in fh:
lines += 1 lines += 1
except IOError: except:
return None return None
return lines return lines