if something goes wrong, just return None.
This commit is contained in:
parent
40c5656910
commit
c8960e2bde
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue