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
1 changed files with 1 additions and 1 deletions

View File

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