Check that file exists

alt-html-css
Bob Mottram 2020-12-19 13:23:30 +00:00
parent de1bfa8ed4
commit b2658ebc31
1 changed files with 3 additions and 0 deletions

View File

@ -93,6 +93,9 @@ def isFilteredBase(filename: str, content: str) -> bool:
"""Uses the given file containing filtered words to check
the given content
"""
if not os.path.isfile(filename):
return False
with open(filename, 'r') as fp:
for line in fp:
filterStr = line.replace('\n', '').replace('\r', '')