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:
|
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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue