Skip to content

Commit

Permalink
Merge pull request #2 from assafs/validate_file_exists
Browse files Browse the repository at this point in the history
Make sure file exists before stating
  • Loading branch information
assafs committed Feb 3, 2016
2 parents 39b99a0 + abc0fd3 commit f356337
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pygtail/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def _get_all_base_dir_files(self):
return listdir(self._base_dir)

def _regular_files_in_dir(self):
return filter(self._filter_func, [f for f in self._get_all_base_dir_files() if stat(self._make_filename(f)).st_mode & S_IFREG > 0])
return filter(self._filter_func, [f for f in self._get_all_base_dir_files() if exists(f) and stat(self._make_filename(f)).st_mode & S_IFREG > 0])

def _update_file_set(self):
"""
Expand Down

0 comments on commit f356337

Please sign in to comment.